Compensating filters

ABSTRACT

A prefilter (5) for an audio system comprising a loudspeaker (1) in a room (2), which corrects both amplitude and phase errors due to the loudspeaker (1) by a linear phase correction filter response and corrects the amplitude response of the room (2) whilst introducing the minimum possible amount of extra phase distortion by employing a minimum phase correction filter stage. A test signal generator (8) generates a signal comprising a periodic frequency sweep with a greater phase repetition period than the frequency repetition period. A microphone (7) positioned at various points in the room (2) measures the audio signal processed by the room (2) and loudspeaker (1), and a coefficient calculator (6) (e.g. a digital signal processor device) derives the signal response of the room and thereby a requisite minimum phase correction to be cascaded with the linear phase correction already calculated for the loudspeaker (1). Filter (5) may comprise the same digital signal processor as the coefficient calculator (6). Applications in high fidelity audio reproduction, and in car stereo reproduction.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to filtering audio signals to compensate theeffects of acoustic and/or electrical stages in the signal path from theoriginal sound source to the human ear.

2. Discussion of Prior Art

In general, this signal path will include a pickup receiving the sound,and converting it to, typically, an electrical signal; signaltransmission channels; signal processing (e.g. filtering, tone controlor noise reduction); signal transmission, or alternatively recording onto a record carrier; signal reception or alternatively replaying fromthe record carrier; a further transmission link; and reconversion intoan audio signal via an electro-acoustic transducer. If the transducer isa loudspeaker, the final stage in the path is transmission through anacoustic environment (typically a room) to the human ear.

Associated with each stage of the signal path is a transfercharacteristic, and at various stages in the path attempts may be madeto filter the signal to compensate the effects of these transfercharacteristics. Compensation generally takes place at a stage in thesignal path subsequent to the stages to be compensated. For example, inthe case of a sound recording, the signal will be filtered at the mixingand cutting stages so as to compensate, if necessary, for the recordingenvironment and equipment (amongst other things).

At the reproduction stage, it is nowadays common to provide a so called"graphic equalizer" comprising a plurality of band pass filters eachwith its own gain control, though which the signal is passed, to allow alistener to re-equalize the reproduced sound signal. The graphicequalizer is generally positioned between the record carrier reader(e.g. turntable or compact disc player) and the power amplifier drivingthe electro-acoustic transducer (loudspeaker).

Since such equalizers are adjusted manually, their setting is a matterfor the personal taste of the listener but they can be used (and areintended for use) to compensate for large scale irregularities in theamplitude response over frequency of the electro-acoustic transducer orof the acoustic environment in which the transducer is positioned.

In fact, with modern high fidelity audio equipment, the major variationsin sound reproduction quality are due to the transfer functions of theloudspeaker and of the acoustic environment in which the loudspeaker ispositioned.

The loudspeaker often comprises several separate transducers responsiveto different frequency ranges, the loudspeaker input signal being splitinto the ranges by a crossover network (generally an analogue filter),and the transducers being mounted in a cabinet. The transfer function ofthe loudspeaker will thus depend upon the electrical characteristics ofthe crossover network and of the transducers; on the relevant positionsof the transducers; and on the mechanical resonances of the cabinet.

The transfer function of the acoustic environment may be visualised byconsidering that the signal passes though multiple paths between theloudspeaker and the human ear; as well as the direct path through theair between the two, there will generally be a path through the floor onwhich the loudspeaker and user stand, and reflected paths from the (atleast) four walls, ceiling and floor. This leads to constructive anddestructive acoustic interference and to standing wave patterns ofconsiderable complexity within the room, so that the paths from theloudspeaker to different points in the room will have different transfercharacteristics--where the room exhibits pronounced resonances, thesetransfer characteristics can be extremely different, with completecancellation at some frequencies, the frequencies differing betweendifferent points. These effects are audible as colorations of thereproduced sound, and as relatively long reverberations.

It would in principle be desirable to provide a compensating filter andmeans for deriving the parameters of the filter such that a given soundsource would be reproduced substantially identically through anyloudspeaker and/or acoustic environment, so as to free the listener fromthe need to carefully select certain loudspeakers, and pay attention totheir position within a room and to the acoustic properties of the room.

One example of a proposal to achieve exactly this is described in U.S.Pat. No. 4,458,362 and corresponding EP0094762A, in which it is proposedto provide a finite impulse response digital filter (implemented by amicrocomputer and a random access memory) in the signal path precedingthe loudspeaker. The coefficients of the filter are derived in aninitial phase, in which a listener positions himself at his desiredlistening point within a room and instructs the microprocessor togenerate a test signal which is propagated via the loudspeaker throughthe room to the listener position and picked up by a microphone carriedby the listener. From the test signal and signal picked up by themicrophone, the impulse response of the intervening portions of thesignal path (e.g. the loudspeaker and the acoustic path through the roomto that listener position) is derived and the coefficients of an FIRfilter approximating the inverse transfer characteristic to that of thesignal path are calculated and used in subsequent filtering.

However, this attractively simple idea suffers from major drawbacks inpractice. Firstly, since the transfer characteristic of the signal pathis derived to only a single listener point within a room, and since (asdiscussed above) the transfer characteristics of signal paths to closelyspaced points in the room can have widely different transfercharacteristics because of the presence of multiple room resonances, ifthe listener moves within the room, then the transfer characteristicderived for the filter becomes inappropriate so that, far fromcompensating for the effects of the room, the filter may actuallyfurther degrade the sound heard by the listener at his new position.

The disclosure of U.S. Pat. No. 4,458,362 further refers only tocompensating the frequency response of elements of the signal path andignores the phase responses of those elements. Although it is commonlythought that the human ear is relatively insensitive to phase, we havefound that phase distortion, even at low levels, can be perceptuallysignificant to a listener.

Different elements of the signal path will exhibit different phasebehaviour; the behaviour of loudspeakers depends variously on thecrossover network, the transducers and the cabinet dimensions. The phaseresponse of the acoustic environment, however, can be extremely complexdue to the reflection or resonances from the room boundaries. These giverise to sharp changes in the phase response of the path to a singlepoint in the room.

Another problem is that it is possible, at some points in the room, forsound to reach a listener by a first path at a relatively low level andthen by a second path at a relatively higher level; the first pathcould, for example, be through the floor of the room; or the first pathcould be a direct path from the loudspeaker through the air and thesecond a reflection of greater magnitude (which can occur if tworeflections add up in amplitude and phase). The effect in any event isthat instead of hearing a sound followed by a fainter echo, the listenerhears a "pre-echo" followed by a louder sound, which is perceived asextremely unnatural.

It is relatively straightforward to cancel an echo; an IIR filter havinga delay equivalent to the echo length and a loop gain equivalent to -1times the attenuation of the echo can be used, or an FIR filter oflength sufficiently long to approximate such an IIR filter can beemployed with suitable tap values. However, compensating a pre-echo isconsiderably more difficult. A direct compensation is impossible, sincethe corresponding IIR filter would be unstable, and it is necessary toemploy a bulk delay within the compensating filter so that the impulseresponse of the compensating filter itself can be made acausal.

It is therefore clear that such filters themselves will introducepre-echo, calculated to exactly compensate that introduced by theacoustic environment. However, because the pre-echo time and amount arethemselves sensitive functions of the listener position in the room, afilter calculated to compensate at one point will not only fail tocompensate pre-echo at another point but will introduce a furtherpre-echo of its own which sounds extremely unnatural to a listener. Evenif no distinct echo is heard, a low level of response occuring prior tothe arrival of the main part of the impulse response.

SUMMARY OF THE INVENTION

The invention generally provides a filter (preferably a digital filter)in which the substantially direction independent portion of the path(including loudspeaker and acoustic environment) is compensated so as tosubstantially linearise the phase response thereof, and thedirectionally dependent parts of the response are compensated so as toflatten the amplitude response without introducing further phasedistortion. The substantially direction independent part of the responseincludes substantially the loudspeaker response, and more particularlythe electrical portions thereof. Also provided are methods of processingsignals to yield the parameters of such filters, and methods ofmanufacturing such filters using the results of such processing.

Also provided according to one aspect of the invention is audioprocessing apparatus which includes data relating to the response of theloudspeaker with which it is supplied or to be used, capable ofgenerating a test signal through the loudspeaker and of measuring thetest signal received at a plurality of points in the room to derive arepresentative room signal response taking account of the loudspeakerresponse data, and thereby generating filter parameters for subsequentaudio reproduction in such a manner as not to generate audiblepre-echos.

In another aspect, the invention provides a user controllable phasecorrection to compensate phase lead errors on audio source material, asa post filter.

Other aspects, embodiments, objects and advantages of the invention willbe apparent from the description and claims.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will now be illustrated, by way of example only, withreference to the accompanying drawings in which:

FIGS. 1a and 1b illustrate schematically the disposition of elements ofthe invention and environment;

FIG. 2 is a schematic block diagram of apparatus according to theinvention;

FIG. 3 illustrates schematically a method of deriving thecharacteristics of a filter to be used in the apparatus of FIG. 2;

FIG. 4 illustrates in greater detail the method of FIG. 3;

FIG. 5 illustrates in greater detail the method of deriving loudspeakerparameters in the method of FIG. 4;

FIG. 6 illustrates in greater detail the method of deriving roomparameters in the method of FIG. 4;

FIG. 7 illustrates a modification of the method of FIG. 6;

FIG. 8 illustrates schematically the method of combining FIGS. 5 and 6in FIG. 4;

FIG. 9 illustrates a step in the method of FIG. 7;

FIG. 10 illustrates a further step in the method of FIG. 7;

FIG. 11a illustrates a step in the method of FIG. 10;

FIG. 11b illustrates and alternative method to that of FIGS. 10 and 11a;

FIG. 12 illustrates the form of a filter 5 in FIG. 2 according to afirst embodiment of the invention;

FIG. 13 illustrates a modification to the method of FIG. 6 or FIG. 7 foruse with this first embodiment of the invention;

FIG. 14 illustrates schematically the form of a filter 5 according to asecond embodiment of the invention;

FIG. 15 illustrates schematically the method of deriving the parametersof the filter of FIG. 14;

FIGS. 16a-16c illustrate in greater detail stages of the method of FIG.15;

FIG. 17 illustrates in detail one example of the method according toFIG. 15;

FIG. 18 illustrates schematically a variation of the method of FIG. 17;

FIG. 19 illustrates schematically the structure of a filter embodying asecond aspect of the invention;

FIG. 20 shows schematically the function of the filter of FIG. 12including this embodiment;

FIG. 21 illustrates schematically the gain of the further component ofthe filter of FIG. 20;

FIGS. 22a and 22b illustrate schematically the amplitude and frequencybehaviour against time of a known test signal;

FIGS. 22c and 22d illustrate correspondingly the behaviour of a testsignal according to a first embodiment of the invention;

FIGS. 22e and 22f illustrate correspondingly the behaviour of a testsignal according to a second embodiment of the invention;

FIG. 23 illustrates schematically the structure of a test signalgenerator for generating the signals of FIG. 22;

FIG. 24 illustrates schematically the elements of a stereo embodiment ofthe invention corresponding to FIG. 2;

FIG. 25a and 25b shows schematically alternative method of derivingparameters for equalizing the stereo channels of the system of FIG. 24;

FIG. 26 shows schematically a variant of part of the system of FIG. 24;

FIGS. 27a and 27b show schematically apparatus according to a furtheraspect of the invention;

FIG. 28 shows schematically a method of deriving characteristics of afilter of FIG. 27b;

FIG. 29 shows schematically an arrangement for measuring the response ofa crossover network;

FIG. 30 illustrates schematically the inverse impulse response of thecrossover network;

FIG. 31 shows the application of the invention to automobile audioreproduction systems;

FIG. 32 shows schematically the external appearance of apparatus fordomestic audio reproduction;

FIG. 33 shows schematically the structure of a processor forming part ofthe apparatus for FIG. 32;

FIG. 34 is a block diagram of the apparatus of FIG. 32;

FIG. 35 shows schematically an embodiment of the invention for audiovisual reproduction;

FIG. 36 shows schematically the structure of a filter according to apreferred embodiment of the invention;

FIGS. 37a-c shows schematically modification of the impulse response ofa phase lead correction filter according to an aspect of the invention;

FIG. 38 is a block diagram showing schematically the structure of atesting system according to a further aspect of the invention;

FIG. 39 is a flow diagram showing the operation of the system of FIG.38;

FIG. 40 is a block diagram showing a portion of the test signalgenerator of FIG. 38, in greater detail;

FIG. 41 is a block diagram showing a portion of the test signal analyserof FIG. 38 in greater detail; and

FIGS. 42a-f are diagrams showing illustratively the spectra, in theFourier domain, of signals at various stages of the system of FIGS. 38,40 and 41.

DETAILED DISCUSSION OF PREFERRED EMBODIMENTS Physical Model

Referring to FIG. 1a, a loudspeaker 1 is positioned within a room orother acoustic environment 2. Also within the room 2 is a listeningpoint 3; a microphone at this point is illustrated, but in use a humanear would take its place. The loudspeaker 1 is fed from a signal source4 an electrical signal representing a sound signal to be reproduced bythe loudspeaker 1. In the electrical path between the source 4 andloudspeaker 1 is the compensating filter apparatus 5 the subject of thepresent invention.

The acoustic signal generated by the loudspeaker in response to theelectrical signal it receives traverses the acoustic environment 2 byseveral paths; through the floor, directly through the air, and viamultiple reflections from the walls, floor and ceiling. The walls, floorand ceiling will to some extent attenuate the acoustic signal with eachreflection. If the degree of attenuation is relatively low, longresonances lasting several seconds can build up depending upon thedimensions of the room 2, leading to sharp peaks and troughs in thefrequency spectrum of the room 2.

The peak height is a measure of resonance amplitude, whereas thesharpness or narrowness in the spectral domain is a measure of thelength in time of the reverberation or resonance, or the Q factorassocated therewith. High Q, long lasting resonances, even of lowamplitude, are psycho-acoustically undesirable. In the low frequencyregion below around 600 kHz, complicated three dimensional standing wavepatterns may be present.

Signal Model

Referring to FIG. 1b, the path taken by an audio signal to reach thelistener at the listening position 3 is as follows. The source 4providing the signal to the loudspeaker 1 is equivalent to an originalaudio source such as a human speaker or a musical instrument, designatedas 4a, which has passed through an electrical reproduction system suchas a microphone, a recording studio, a reproduction turntable or tapedeck and associated interconnection lines, designated generally as 4b.The original audio signal will be designated S, and the transferfunction of the electrical reproduction stage 4b will be designatedF_(s), so than the electrical signal X supplied by the source 4comprises S*F_(s) (where * denotes multiplication in the frequencydomain or, correspondingly, convolution in the time domain).

The signal X thereafter passes through, and is filtered by, thecompensating filter 5 the transfer function of which is designated F⁻¹for reasons discussed below. Thereafter the filtered signal Y is fed(possibly through a power amplifier) to the loudspeaker 1. Theloudspeaker 1 generally comprises an electrical crossover network 1a,typically a fourth order passive filter, splitting the signal intoseveral frequency ranges--typically, a bass frequency range (below 300Hz), a mid-frequency range (between la will be designated F_(x). Eachfiltered signal is this and 3000 Hz) and a treble frequency range (abovethis). The transfer function of the crossover network then supplied to arespective transducer; typically, a moving coil cone transducer for thebass frequencies and moving coil or piezo ceramic dome transducers formid and treble frequencies. These are mounted within a loudspeakercabinet.

These elements of the loudspeaker may be viewed as exhibiting a transferfunction F_(L) which is due in part to the electrical parameters of thetransducers, and in part to the geometrical disposition of thetransducers and to the mechanical properties of the cabinet. In general,these latter parameters are directional so that in fact the transferfunction of the loudspeaker depends upon the position of the listenerrelative to the forward axis of the loudspeaker (i.e. the axis alongwhich the transducers vibrate). However, for present purposes, thetransfer function of the loudspeaker in this description will generallybe understood to refer to its transfer function along the loudspeakeraxis, and at a distance sufficiently great that near-field effects arenot overwhelming.

The audio signal generated by the loudspeaker 1 passes to the listenerpoint 3 through the acoustic environment 2, which imposes on the audiosignal a transfer function which generally comprises a number ofdifferent signal paths having differing attenuations and also in generalresonances. For any given listener point 3, a room transfer functionF_(r) can be designated and measured but considered as a whole theacoustic environment 2 cannot be described by a single transferfunction. The term "room transfer function", when used in the following,is used to indicate a transfer function which is valid over a contiguousvolume of the room as an approximation to the transfer function betweenthe loudspeaker 1 and different listener positions 3 within that volume.

The entire signal path between the source 4 and the listener position 3may therefore be considered to exhibit a lumped transfer function F,comprising F_(x) *F_(l) *F_(r), (or F_(L) *F_(R) where F_(L) =F_(x)*F_(l) is the response of the whole loudspeaker unit) and thecompensating filter 5 should exhibit a transfer function F⁻¹ which tendsto flatten, or reduce to unity, the lumped transfer function F of thesignal path.

Description of Hardware Filter 5

It is greatly preferred to realise the filter 5 as a digital filter byproviding a digital input coupled to a highspeed digital processoroperable to execute a stored program utilising a buffer memory to storeprevious input values and/or previous output values.

As is well known, a digital filter operates by generating a series ofoutput values in dependence upon combinations of previous input and/oroutput values stored in the buffer memory multiplied by digitalcoefficients which thus characterise the filter.

A Digital Signal Processor (DSP) device comprising a program memory,arithmetic logic, a multiplier and fast data memory is employed as thefilter 5.

Test Signal Generator 8

Also provided in this embodiment is a test signal generator 8 whichsupplies an electrical test signal to the input of the loudspeaker 1directly (i.e. not via the filter 5). The test signal includes signalfrequency components across the range over which it is intended toequalise the lumped transfer function F (as discussed in greater detailbelow).

Coefficient Calculator 6

A coefficient calculator 6 is provided, connectable to a microphone 7,and arranged to calculate from the signal from the microphone 7 thecoefficients for the filter 5 and to supply them to the filter. Since inthis embodiment the filter 5 and the coefficient calculator 6 are notsimultaneously employed, the processor device which comprises the filter5 may also comprise the coefficient calculator 6 by executing adifferent stored program.

General Operation of the Invention

One essential feature of the invention arises from our realisation thatthe transfer functions of the loudspeaker 1 and of the acousticenvironment 2 are qualitatively different, and that it is advantageousto model and compensate the two separately (although, of course, thesame filter hardware 5 is preferably used to compensate both). However,there are very considerable difficulties in separately measuring the twotransfer functions in practice, since a loudspeaker is required toinject an audio signal into the acoustic environment, and a far fieldloudspeaker response cannot be measured except within an acousticenvironment. It is possible to calculate a mathematical approximation tothe various transfer functions. For example, if the type and cutofffrequency of the crossover network is specified its transfer functionshould be easy to calculate. This applies also to the electrical parts(e.g. the moving coil) of the loudspeaker. However, modelling themechanical behaviour of the loudspeaker is complex, and modelling theacoustic behaviour of an environment such as a room is extremely complexbecause of the very large number of possible resonances. It is thereforeprefered to derive the transfer functions of the loudspeaker and room bymeasurement.

The response of a component to a signal can be described in many ways;time domain descriptions such as the impulse response or the autocorrelation spectrum; and spectral response descriptions such as thecomplex frequency spectrum or the power spectrum are amongst them. Thevarious processes of measuring the loudspeaker and room responses,processing the responses, and designing the parameters of a filter tocompensate therefor, can therefore be performed in many ways. In thefollowing, for simplicity of presentation, the response measurement andfilter design will be described using frequency domain methods, fromwhich alternative methods will be obvious to the skilled man.

Referring to FIG. 3, the general method of operation of the coefficientcalculator 8 is to obtain, separately, a model of the loudspeakerresponse substantially independent of the environment, and a model ofthe environment response (which will be valid over a zone within theenvironment) which is substantially independent of the loudspeakerresponse. The coefficient calculator 6 then calculates the coefficientsof a filter which will compensate for the loudspeaker and for theenvironment in different ways taking account of the different physicalnatures of the loudspeaker and of the environment. The phase response ofthe loudspeaker can be compensated to substantially eliminate phasedistortions introduced by the loudspeaker, since the loudspeakerresponse is largely independent of direction and position of thelistener relative to the loudspeaker. The acoustic environment (e.g.room) is compensated so as to equalise its amplitude response butwithout completely equalising its phase resonse so as to avoidintroducing further phase errors. The coefficients of a signal filterwhich combines both compensations are supplied to the filter 5 to enablesubsequent filtered audio reproduction via the loudspeaker 1.

Referring to FIG. 4, the process of FIG. 3 will be described in greaterdetail. The response of the loudspeaker 1 is measured by placing theloudspeaker in an echo free environment, passing a test signal throughthe loudspeaker, and picking up the reproduced audio signal via amicrophone. From the signal measured by the microphone, a suitable modelof the loudspeaker response is derived. From this model, the responsenecessary to compensate the loudspeaker is derived; in a simple case,this is merely the spectral inverse of the loudspeaker response itself.The model loudspeaker response and the loudspeaker compensation responsedata are then stored for subsequent use.

The loudspeaker 1 is then positioned within the acoustic environment inwhich it is to be used, and the microphone 7 is placed at a listenerposition within the environment. An electrical test signal from the testsignal generator 8 is supplied to the loudspeaker 1 and the resultingaudio signal received at the microphone 7 is measured and stored. Themicrophone 7 is then moved to another point and the process is repeated.Once sufficient measurements have been taken, the coefficient calculator6 calculates a room response from a combination of the storedmeasurements, to be jointly representative of all the points at whichthe measurements were taken. This response includes the response due tothe loudspeaker 1. The coefficient calculator 6 therefore uses thestored model loudspeaker response F_(L) jointly with the combinedmeasured response to derive the response of the acoustic environment 2F_(R) only, eliminating the dependency upon the loudspeaker 1. Acompensation response F_(R) ⁻¹ to substantially compensate the roomresponse is derived, and combined with the loudspeaker compensationresponse F_(L) ⁻¹. From the combined compensation response thecoefficients of the digital filter 5 to execute the combinedcompensation are derived and supplied to the filter 5 for use insubsequent audio reproduction.

Loudspeaker Compensation

To measure the loudspeaker response, as shown in FIG. 4, the loudspeakeris placed in an anechoic chamber comprising a room the walls andceilings of which are heavily acoustically damped, the microphone 7 (forexample an electret microphone with a response down to about 20 Hz) ispositioned on the loudspeaker axis in front of the loudspeaker at adistance away from the near field of the bass unit (20-30 cms from thecone for example) and the loudspeaker 1 is fed with a test signal by thetest signal generator 8. The signal received by the microphone 7 isanti-alias filtered, sampled and digitised by a conventional ADC (notshown) and the digital signal is supplied to the coefficient calculator6.

Referring to FIG. 5, the process of deriving the transfer function orresponse of the loudspeaker from the measured signal first comprises thestep of taking the Fourier transform of the signal.

For simplicity, in the following the effects of a single impulse testsignal will be discussed; the signal measured by the microphone 7therefore directly yields the impulse response of the loudspeaker. Ifother test signals are used, it is necessary to derive the impulseresponse of the loudspeaker from the measured signal by deconvolving thetest signal response from the measured response as discussed in greaterdetail below.

The measured response may be improved by utilising any other knowledgeof the expected response; for example, many loudspeakers have alog/linear low frequency rolloff with a slope of six, twelve or 24dB/octave, and a mathematically calculated curve can therefore be fittedto the measured data in the low frequency region of the response.Alternatively, the response can be calculated from measurements ofdimensions and mass of the loudspeaker components.

It is also preferred that any rapid variations of phase with frequency(expressed as a logarithmic scale) are left uncompensated so that thecompensating filter corrects only broad trends in the phase (andamplitude) response of the loudspeaker. This is because these rapidvariations of phase are likely to be due to mechanical resonances of theloudspeaker cabinet, and consequently will sound different in differentdirections around the loudspeaker--exact compensation for one microphoneposition would therefore worsen the response at other listenerpositions. To achieve this, a smoothing operation is performed on thederived Fourier transfer coefficients.

The next step is to generate, from the measured response, the responseof a compensation filter which, when multiplied by the loudspeakerresponse in the frequency domain (or convolved therewith in the timedomain) will achieve a desired target response. The desired targetresponse for an "ideal" loudspeaker has the following features; itsamplitude spectrum should be essentially flat over the audible range; itshould, however, taper off smoothly at very low frequencies to avoidoverloading the loudspeaker; and its phase response should be linear(within the passband at any rate) to avoid phase distortion (and give aconstant group delay). Merely deriving the inverse to the measuredloudspeaker response (i.e. setting the target response as unity) wouldcause the filter to boost the amplitude response at low frequencies(possibly by as much as twelve or twenty-four dB/octave), leading topossible speaker overload.

It is particularly important to equalise the phase response of theloudspeaker at low frequencies, including the rolloff frequencies, andphase anomalies above about 300-500 Hz are less noticable.

The spectral description of the target response (e.g. flat amplitudespectrum down to 100 Hz, tapering into linear low frequency rolloff oftwelve dB/octave, linear phase response at least over lower frequencies)will be permanently stored in the coefficient calculator 6. Themeasured, smoothed, loudspeaker response is divided into this targetresponse to provide a spectral description F_(L) ⁻¹ of the loudspeakercompensating filter response. The coefficient calculator 6 can then, ata later stage, derive corresponding filter coefficients from thisdescription using any convenient algorithm for the type of filterdesired. For a FIR filter, it is merely necessary to apply an inverseFourier transform to directly derive the impulse response (e.g. thecoefficients) of the filter.

Acoustic Environment Measurement

It would be possible to measure the response of the acoustic environment2 using a different loudspeaker, for example one with a substantiallyideal response. However, we prefer to employ the loudspeaker to be usedin the room as shown in FIG. 4 so that elements of the loudspeakerresponse not compensated by the loudspeaker compensating filter F⁻¹ _(L)can be lumped into, and compensated with, the room compensating filterF⁻¹ _(R) response.

This is particularly beneficial because those rapidly fluctuatingcomponents of the loudspeaker response F_(L) which are direction orposition dependent, and were consequently not taken account of inderiving the loudspeaker compensation response F_(L) ⁻¹ are suitable tobe compensated in the same manner as the acoustic environment.

Having decided to employ the same loudspeaker to measure the roomresponse, the obvious method of so doing would be to feed theloudspeaker 1 with a compensated signal passed through the loudspeakercompensating filter so that the acoustic test signal introduced into theacoustic environment 2 is not affected by the response of theloudspeaker itself. However, we find that this method can be affected bythe presence of electrical and acoustic noise in the path. Moreseriously, the rolloff introduced by the loudspeaker compensation filterwould then be compensated for by the room compensation. Additionally,this method will generally tend to result in a longer filter (comprisinga cascade of the loudspeaker compensating filter and the roomcompensating filter), leading to more calculations being necessary inreal time filtering.

Referring to FIGS. 4 and 5, the environment response is thereforemeasured as follows. The loudspeaker 1 is positioned as desired in theacoustic environment (e.g. room) 2. A compensated volume or zone isdesignated within the room; this is typically a couch or other area ofthe room where a listener is likely to be. The microphone 7 ispositioned at a first point within the compensated volume. The testsignal generator 8 generates a test signal which is supplied directly tothe loudspeaker 1 which correspondingly generates an audio signal(equivalent to the test signal influenced by the loudspeaker response)within the room 2. The audio signal travels through the room 2 viamultiple paths and reaches the microphone 7 which correspondinglygenerate a measured signal, which is digitised as before and supplied tothe coefficient calculator 6.

The microphone is then moved to another position within the compensatingvolume and the process is repeated. The coefficient calculator 6 storesthe signal from the microphone for each position. When measurements havebeen taken at a suitable number of positions the coefficient calculator6 then generates an averaged (in a loose sense) system response from themeasured signal, and obtains from this the averaged room response F_(r)by taking acount of the already measured loudspeaker response F_(L).After adjusting the derived room response F_(r) (as described in greaterdetail below), a desired correction response is calculated and from thisand the compensation response F_(L) ⁻¹ derived for the loudspeaker,coefficients for a filter F⁻¹ are calculated which when executed by thefilter 5 will compensate both the loudspeaker 1 and the room 2. Thefilter coefficients for this are then supplied to the filter 5 forsubsequent processing of audio signals from the source 4.

Referring to FIG. 6, the process by which the coefficient calculator 6derives the room response F_(r), the room compensation response F_(r) ⁻¹will now be described in greater detail. As stated above, the storedtarget response for the room has a broadly flat amplitude spectrum.

The first step is to combine the responses of the measured signal; thisis conveniently done in the spectral domain by executing a Fouriertransform on the impulse response obtained from the measured signals,averaging the Fourier transform spectra from all the measured points inthe room and averaging the Fourier spectra using some convenient average(not necessarily the arithmetic mean) to give an averaged spectrum. Thisprocess of averaging in the spectral domain reduces the local amplituderesponse differences due to standing wave patterns and reflectionswithin the acoustic environment 2. It is preferred to average theamplitude spectra only, rather than amplitude and phase spectra;averaging the power spectra is one convenient amplitude related method.

The response of the compensating filter F_(r) ⁻¹ is desired to exhibitminimum phase behaviour so as to avoid the possibility of introducingpre-echos.

A minimum phase filter is a causal filter having the lowest deviationfrom zero phase response achievable for a given amplitude response. As aconsequence, the envelope of its impulse response is tightly confinedaround the t=0 (e.g. the initial) impulse response component.

It is mathematically demonstrable that the phase response of a minimumphase filter is directly related to the amplitude response of thefilter. It is in fact given by computing the logarithm of the spectralpower response, computing the Hilbert transform of the result, and thenderiving a filter with amplitude equal to the square root of thespectral power response and phase equal to the calculated Hilberttransform.

The coefficient calculator 6 therefore calculates, for each of thestored microphone signals, the spectral power response; convenientlythis is achieved by performing a discrete Fourier transform and thentaking the modulus (squared) of each complex term. The correspondingterms for each stored signal are then summed to yield an averagespectral power response representing the spectral power response overthe entire compensation volume. FIG. 7 illustrates the process of FIG. 6adapted for a minimum phase room compensation response.

The next step is to divide out from the measured response thecontribution to the transfer function due to the loudspeaker 1. Theloudspeaker response F_(L) will already be available, having beenmeasured as described above, although it is preferred to use thesmoothed response F_(L) (omitting rapidly changing phase components)since the position of the microphone 7 within the room 2 will inevitablydiffer from the microphone position at which the loudspeaker responsemeasurements were taken, and the uncompensated parts of the loudspeakerresponse are thus left in the desired room response F_(R). The averagedmeasured spectrum is therefore divided by the modulus of the spectralresponse of the loudspeaker to produce a response approximating that ofthe room.

Processing the Room Spectrum

Although averaging the measured response from a number of points helpsto somewhat reduce the influence of some room resonance effects at lowfrequencies, the averaged room response may still contain sharp peakscorresponding to particular resonances and deep troughs. Deep troughsare particularly problematical, since a straightforward compensationfilter would strongly boost the signal at frequencies corresponding totrough, which can lead to loudspeaker overloading. Additionally, inother areas of the room the original trough may not be noticable but theboost applied to the signal certainly will. We have discovered that thepsycho-acoustic effect of troughs in a frequency response is far lessnoticable to a listener than that of peaks in a response. We thereforeprefer for this reason also not to introduce large peaks into theresponse of the correction filter, so that the correction filter is lessresponsive to troughs in the measured room response than to peaks.

The sharpness of any troughs is also of significance, since acorrespondingly sharp feature in the compensating filter responseimplies a high Q factor and we have found that the psycho-acousticeffects of such high Q filtering can be extremely subjectivelyundesirable to the listener. Even quite low-level resonances can, ifthey continue for a long time, be disturbing to the listener.

Rather than generating a compensating filter which corresponds to thespectral inverse of the measured room response, it is thereforepreferred to make the compensating filter correspond to a processedversion of the room response.

The processing smooths (i.e. reduces the amplitude and/or sharpness) ofpeaks and, more particularly, troughs in the room response spectrum asdiscussed in greater detail below. Having generated a smoothed roomresponse, F_(R) the next step is to calculate the response F_(R) ⁻¹ of afilter to compensate the room response. The desired filter amplituderesponse is obtained simply by taking the square root of each powerspectrum term and dividing the result into unity (or, in principle, adifferent room target response). The desired phase response is, for aminimum phase filter, directly calculated from the amplitude spectrum asthe Hilbert transform of the logarithm of the amplitude spectrum. Fromthe phase and amplitude spectra, the required filter coefficients can bederived by an inverse Fourier transform back into the time domain, withappropriate windowing to limit the length of the filter. Although itwould be possible to separately derive the room correction filter, it isprefered that, as shown in FIG. 8, once the phase and amplitude spectraof the desired room correction filter have been calculated, they aremultiplied with the spectra already derived for the loudspeakercorrection filter to provide a frequency domain description of acombined correction filter calculated to compensate both the loudspeakerand the room; for a FIR filter, coefficients of the combined filter arethen derived by inverse Fourier transform of the combined spectralresponse.

The filter coefficients thus calculated are then stored for use by thedigital filter 5 in subsequent audio reproduction.

Referring to FIG. 9, the processing comprises two operations; anamplitude adjusting step in which the amplitude of spectral componentsis adjusted in dependence upon their own value in a non-linear fashionso that the depth of troughs is reduced, and a smoothing step in whichthe amplitude of each spectral component is adjusted in dependence uponthat of its neighbouring components so as to provide some degree ofsmoothing, averaging or low pass filtering of the spectral powerresponse which reduces the sharpness of peaks and troughs. This may beachieved simply by providing a moving average over a number of samples(a rectangular smoothing kernel or window), or by employing a moresophisticated smoothing kernel such as a triangular or quadratic kernel.The kernel shape also has some effect on truncating the length of theeventual filter; the smoother the spectrum, the shorter the filter.

The choice of the form of adjustment depends primarily upon the size ofthe listening area or compensation volume within the room which it isdesired to compensate. For equalisation at a single point, it ispossible to exactly compensate even the deepest trough or highest peakwithout undesirable psycho-acoustic effects. For a small compensationvolume, a relatively small adjustment avoids severe psycho-acousticeffects but provides detailed equalisation of response dips, whereas alarger adjustment, necessary for a larger compensation zone, produces acompensation filter which does not compensate deep or narrow responsetroughs. In fact, it is found that the volume over which a compensatingfilter having a given degree of adjustment operates is on the order of apredetermined number of wave lengths irrespective of frequency; in otherwords, in order to compensate over a given volume for all frequencies,it is necessary to use a frequency dependent degree of adjustment of theresponse spectrum so as to smooth peaks and troughs to a greater degreeat higher frequencies than at lower frequencies.

We have discovered that at very low frequencies (below 20 Hz or 30 Hz)traffic and machine noise, together with high frequency components ofvariations of atmospheric pressure due to meteorological phenomena, willbe measured by the microphone 7 and hence will erroneously appear to bepart of the room response spectrum. It is therefore preferred to verystrongly smooth the measured room response below some minimum frequencyaround 20-30 Hz.

It is undesirable to have sharp transitions between types of spectralprocessing, however, as this invariably sounds unnatural to thelistener. The amplitude adjustment function used therefore has thefollowing effects on the compensation filter response derived:

1. It makes the compensation filter response substantially independentof large troughs in the room response at very low frequencies:

2. It makes the compensation filter response progressively lessdependent upon troughs in the room response occuring at progressivelyhigher frequencies above some frequency threshold:

3. It applies an approximately constant amount of amplitude adjustmentover the spectral region between very low frequencies and the threshold:and

4. There are not sharp transitions between the three regimes above.

One suitable amplitude adjustment function is as follows: ##EQU1## Wherethe function k(f)² is: ##EQU2##

The constants e and K are empirically set to some suitable value. Itwill be seen that this function achieves the above objects, but manyother amplitude adjustment functions--for example, using powers otherthan 4--could be employed. The coefficient calculator 6 therefore takesthe stored spectral power coefficients, and replaces each by a modifiedspectral power coefficient to yield an amplitude processed set ofcoefficients. Each amplitude modified coefficient is then, as mentionedabove, processed by replacing it with a local average comprising thenormalised sum of that coefficient and its immediate neighbours. Thenumber of immediate neighbours, and hence the resulting spectralsmoothness, is also preferably a function of frequency to achieve thethree broad criteria set out above.

The two operations need not be carried out sequentially, but can becombined. Further, each operation can be made to depend upon the other;thus, the degree of smoothing (i.e. the amount by which the modifiedvalue of each coefficient depends upon its neighbours) may be varied independence upon the amplitude of a coefficient, or vice versa, so thatsharp troughs are both smoothed and reduced in amplitude but othercoefficients are not.

Limited Pre-echo Filtering

In the foregoing, correction for the room acoustic using a minimum phasefilter was proposed. It is found that using this type of correction,room reverberation times (defined as the time taken for an impulseamplitude to die away to some low level, for example -60 dB) aresubstantially reduced, and the response of the entire filter,loudspeaker and acoustic environment path itself has no pre-echos overthe compensating volume.

However, we have found that room reverberation time can be reducedfurther, with little or no penalty in psycho-acoustic acceptability, byallowing the filter 5 to exhibit slightly non-minimum phase behaviour.Since the acoustic environment response cannot be exactly corrected overthe whole compensation volume, a certain amount of phase error bemeasurable at some points, but we find that by constraining the amountof preresponse exhibited by the filter 5 to a much lower level thanwould be the case for linear phase compensation of the room, the resultis still acceptable to the listener.

Typical pre-response times which are acceptable are 20 msecs to 50msecs; one useful (but not rigorous) design rule is found to be that themaximum permitted pre-response time of the filter 5 (or, to be moreaccurate, of the room compensation filter element of the filter 5)should not significantly exceed the difference between the time ofarrival of a sound from the loudspeaker at the compensation volume andthe time of arrival of the first reflection of that sound in thecompensation zone from the most distant reflecting surface of the room.

This measure can of course be calculated for any given room dimensionsand loudspeaker and listener positions, or alternatively could bemeasured from the impulse response of the signal received by themicrophone 7, but in general it is prefered to set the maximum amount ofpre-response for the filter to compensate the acoustic environment at apredetermined level typically less than 50 msecs.

In this context, "pre-response" generally means that portion of theenvelope of the impulse response occuring prior to the peak value of theimpulse response. Where a measurable definition is necessary, thepre-response of a filter may be defined as the time, from the firstcomponent of the impulse response of the all pass part of the filterresponse, to the "centre of gravity" of the all pass impulse response;

    Σa.sub.t.sup.2 *t/Σa.sub.t.sup.2,

where a_(t) is the amplitude of the impulse response at time t.

It is also possible to make some qualitative statements about the shapeof the impulse response of the filter; there should be no discrete peakearlier and lower than the highest peak in the impulse response, as thiswill generally be audible as a pre-echo unless very closely spaced. Wehave also discovered, however, that the ear appears to respond more toearly parts of transients, so that the mere absence of early peaks isinsufficient to eliminate pre-echo; a sharply rising pre-response(compared with the later portions of the impulse response) will stillsound audibly unacceptable, but an extended and slowly risingpre-response generally avoids pre-echos.

Referring to FIG. 10, and recalling that is is possible to consider anygiven response to be the convolution of (i.e. equivalent to a cascadeof) a minimum phase filter and an all pass filter, it will therefore beapparent that the minimum phase correction filter derived by the processof FIG. 7 leaves uncorrected an all pass component of the acousticenvironment function.

Some degree of correction of this component is provided by deriving arepresentative all pass transfer function A of the acoustic environment;truncating the length of the impulse reponse of the all pass component Ato some predetermined limit (e.g. 50 msecs); time reversing the impulseresponse (it being remembered that the convolution of an impulse reponseand its time reversal give rise to a linear phase); deriving the allpass part A⁻¹ of the time reversed response; and convoluting this withthe minimum phase room correction response produced according to theprocess of FIG. 7.

The process of deriving an all-pass part of a response may be achievedin several ways; for example, in the frequency domain, by deriving theminimum phase component of the spectrum and then dividing this into theoriginal spectrum. To avoid division by zero anomalies, the minimumphase component may first be smoothed as above.

The all pass component A of the room response which is selected forcorrection may be derived by deriving the all pass components for eachmicrophone measured signal, separately, and then selecting one of thecalculated all pass responses as representative. This could be one whichcorresponds to a central microphone position within the compensationzone, or could be one exhibiting the lowest deviation from the averageof all the responses.

As an alternative to the above method of deriving the response of thelimited pre-response filter, referring to FIG. 11b the impulse responseis measured at each microphone position (with their initial, t=0,components aligned) may be averaged and the averaged impulse responseFourier transformed. The resulting spectrum is strongly smoothed using alocal averaging kernel as discussed above, and the reciprocal spectrumis derived--or, more specifically the "regularised reciprocal" definedas c*(f)(K+k(f))/c(f)c*(f)+k(f) where c* is the complex conjugate of c,K is chosen to have approximately the same mean value as cc*, and k(f)is an amplitude varying function of the kind discussed above.

As shown in FIG. 11b, the RMS term for each spectrum of the inversespectrum thus derived is multiplied by the RMS power spectrum derived asin FIG. 7, and a minimum phase response is derived to compensate thiscombined response. The inverse spectrum itself is then used as thelimited pre-response all pass which is multiplied by the minimum phasecorrection and the resulting correction spectrum is inverse Fouriertransformed into the time domain to obtain the desired filtercoefficients.

The use of limited pre-response correction of this type with a suitablelimit on the length of the pre-response (generally less than 50 msecs;preferably less than 20 msecs and advantageously less than 10msecs)reflections from within the loudspeaker cabinet, and off the wallsadjacent the loudspeaker, can be cancelled without giving rise toaudible pre-echo. The pre-response limits are, it should be stressed,very much shorter than the amount of pre-response which would normallybe required to provide linear phase correction for the entire room(typically on the order of several seconds).

IMPLEMENTATION

We have found that at low frequencies a filter with a frequencyresolution of down to 1 Hz is desirable for acceptable compensation. Itis also at low frequencies that some of the least acceptable loudspeakerand room phase distortions occur. Providing a filter which would give aresolution of 1 Hz across the full audio band width of 0-15 kHz wouldhowever require a filter having a length of the order 30,000 stages and,at a sampling rate of 30 kHz, therefore require 30,000 times 30,000=900megaflops processing power--which is not at present practicable.

Low Frequency Equalisation

Because many of the features of the responses it is desired to correctoccur at relatively low frequencies (below 1 kHz, or more specificallybelow 500 or 300 kHz), it is possible merely to compensate the room andloudspeaker responses in these frequency regions.

Operating only on the low frequency regions can of course be achieved ata much lower sampling rate and, for a given frequency resolution, ashorter filter. However, because the ear is particularly sensitive tosudden jumps or changes in spectral response it is particularlynecessary to take great care that the transition between the compensatedand uncompensated frequency regions is smooth and gradual withoutdiscontinuities.

Referring to FIG. 12, in an embodiment of the invention for compensatingat low frequencies, the filter 5 may be represented as comprising twoseparate signal paths. The first path 51 includes a delay stage 52characterised by a delay time 1 supplied by the coefficient calculator 6as discussed below. The second path 53 includes a downsampler ordecimation filter 54, receiving input samples at some predetermined rate(for example, 44.1 kHz) and generating output samples at a much reducedrate equivalent to the sampling rate for the frequency range to becompensated (i.e. twice the highest frequency present); for acompensation range up to 500 Hz, the output sample rate would thereforebe 1 kHz.

To avoid aliasing, the downsampler 54 includes low pass filtering;typically, each output sample represents the average of a plurality ofinput samples. The down sampled and band limited signal is filtered by adigital compensating filter 55, so as to effect the desired room/speakercompensation, and the bit rate of the filtered signal is then increasedby an up-sampler 56 back to the input frequency (e.g. 44.1 kHz). Theup-sampler 56 is an interpolating filter receiving successive signalsamples and generating a plurality of interpolated sample values inbetween.

The length of the delay 1 of the delay stage 52 in the first path 51 isequivalent to the lengths of the delays caused by the down converter 54and up converter 56 (which are predetermined and constant) together withthe filter delay D caused by the pre-response of the filter 55 (which iscalculated by the coefficient calculator 6).

In a conventional split band filter, the first path 51 would include ahigh pass filter to match the low pass effects of the down sampler 54.We have found this both undesirable and unnecessary however. Instead,prior to up sampling by the up sampler 56, the down sampled butunfiltered signal delayed by the filter delay D is subtracted from thefiltered output of the filter 55. Thus, instead of adding to theoriginal full band width signal a component comprising the filtered lowfrequency portion thereof, what is added back is the differencegenerated by the compensating filter 55 itself independently of theeffects of the down sampler 54 (which are cancelled by the subtraction).No filtering of the high and mid-range signal components within the path51 is thus necessary.

In fact, there is no need to separately subtract the unfiltered downsampled signal by providing an extra signal delay path 57; instead, thispath may be considered to form part of the filter 55 and, in the case ofan FIR filter, is effected simply by reducing the value of the t=0filter coefficient by unity. The filter coefficient calculator 6therefore performs this subtraction as the last stage in deriving thefilter coefficients of the filter 55.

To derive the filter coefficients, the second signal path 53 is brokenbefore and after the filter 55 at points X and Y respectively. A testsignal (at a sample rate of 1 kHz and containing frequencies between 0and 500 Hz is applied at the point Y, and is interpolated to increasethe sample rate by the upsampler 56 and passed to the loudspeaker 1. Themicrophone 7 is connected to the filter input, and the down sampledoutput of the down sampler 54 is supplied from point X to thecoefficient calculator 6. The signal from the microphone 7 is thusmeasured at the same sample rate as that at which the filter 55 willoperate.

Referring to FIG. 13, the coefficient calculator 6 in this embodimentoperates as described above with reference to FIGS. 3 to 11, except thatbecause the room response measured by the microphone 7 will have beeneffected by the low pass characteristic of the down sampler 54, themeasured room response will fall off to zero at 500 Hz. The desiredcompensation filter should have a response of unity at exactly 500 Hzand above, however, so as not to interfere with the unfiltered signalthrough the delay stage 52. Merely deriving a compensation filter to themeasured response including the fall off at 500 Hz due to the downsampler 54 would therefore result in a compensation filter whichstrongly boosted frequencies just below 500 Hz which would clearly beunacceptable. The room response processing step within FIG. 6 thereforeincludes the step of tapering the measured room response towards a valueof unity and just below 500 Hz, using a function which is progressivewith frequency so as to avoid discontinuities in the compensationresponse. The exact method by which this is achieved is irrelevant, butone possible method is to multiply each spectral term above a givenfrequency (for example 350 Hz) with a function which decreases smoothlyand monotonically from unity at 350 Hz to zero at 500 Hz, and then addunity minus the value of the function; i.e.

    S'(f)=S(f)*L(f)+(l-L(f))

Multiple Band Filter

It is also possible to provide a practical filter 5 capable of filteringthe entire audio spectrum. At higher frequencies, the spectralresolution of the filter is less critical and the compensating filterresponse will have been smoothed to a greater degree as described above.It is therefore possible, in addition to the relatively high resolutionfilter 55 operating at a low sample rate, to use shorter filters 58, 59operating at higher rates, and therefore higher frequencies, but withlower resolution, as illustrated in FIG. 14. By way of example, usingtwo Texas Instruments TMS 320 digital signal processor devices (a firstimplementing the high rate filter and a second implementing the mid andlow rate filters)

filter dimensions of FIR filters were as follows:

    ______________________________________    Filter   Sample Rate (kHz)                             Length  (taps & ms)    ______________________________________    H/F(51)  44.1            75      1.7    M/F(58)  14.7            240     16.33    L/F(59)  1.8375          1024    557.28    ______________________________________    Filter   Pre-response (taps & ms)                                    Resol'n (Hz)    ______________________________________    H/F(55)  20           0.46      294    M/F(58)  80           5.44      30.6    L/F(59)  200          108.84    0.9    ______________________________________

Referring to FIG. 14, the input digital signal is filtered by the highrate filter 59. The input signal is also down sampled by a first downsampler 60 by a factor 3, and fed to the mid-rate filter 58. Thefiltered signal is then interpolated by an up sampler 61 by a factor ofthree, and added to the high rate filtered signal from the filter 59.The down sampled input signal from the down sampler 60 is furtherdecimated by a second down sampler 54 by a factor of 8, and filtered bythe low range filter 55. The low range filtered signal is theninterpolated by a factor 8 by up sampler 56 and added to the filteredsignal from the mid-range filter 58.

As in the embodiment of FIG. 14, the high rate filter 59 does not needto include a low frequency cutoff, since (as explained below) thecoefficients of the lower rate filters take account of the effects ofthe high rate filter in mid and low frequency ranges.

Deriving Split Band Filters

Although the structure of the filter 5 in this case is straight forward,the band splitting complicates the process of filter derivation.

If the coefficients for the filters 55, 58, 59 were derived separately,this could lead to anomalies in the overall response at the transitionfrequencies. Referring to FIG. 15, it is therefore preferred that theresponse for each compensation filter should be derived takingcognizance of the filter for the neighbouring band or bands. Morespecifically, by deriving first the response for the high rate filter59, then deriving the response of the mid-rate filter 58 taking intoaccount that of the high rate filter 59, and then the response of thelow rate filter 55 taking account of both, smooth transitions betweenthe responses of the three filters are obtained.

Referring to FIG. 16a, in a first method of taking account of higherband rate filters when calculating lower band rate filters, the signalmeasured from the microphone 7 is processed at its original band rateand a spectral response is obtained (e.g. by executing a Fouriertransform). The measured signal is also decimated by a down sampler soas to reduce the sample rate, and consequently band limited to half thedecimated sample rate. The spectral response of the down sampledmeasured signal is also obtained. As stated above, this will be bandlimited to half the sampling rate.

In FIG. 13, the process of tapering, or merging, the spectral responsetowards unity at the Nyquist frequency was illustrated. However, whenhigher band rate data is available, the process can be improved bymerging the response spectrum towards that of the corresponding spectralregion of the higher frequency filter at the Nyquist frequency, as shownin FIG. 16A. If the spectral responses at the different rates wereobtained by transforms using different a number of terms over theoperative band width, one spectrum (typically the higher band ratespectrum) will require interpolation of extra terms to intersperse theexisting terms so that they match the terms of the lower rate spectrum.The operation of merging the two spectra at the Nyquist frequency isequivalent to that set out in FIG. 13; the corresponding expression is:

    S'(f)=S.sub.L (f)L(f)+S.sub.F (f)(l-L(f))

If the spectral responses at the different rates were obtained bytransforms using a different number of terms over the operative bandwidth, and hence having a different resolution, it is advantageous tosmooth the spectra using a frequency dependent smoothing kernel tosmooth the higher resolution spectrum to match the lower resolutionspectrum at the transition between the two.

The second method by which account is taken of compensation in higherfrequency bands is illustrated in FIG. 16B. In deriving theco-efficients of the high rate compensation response, at least if afinite impulse response filter is used, it will generally have beennecessary to generate a filter having a shorter length than would berequired to exactly possess the calculated compensation response. Thisis conveniently achieved by windowing the impulse response obtained byapplying the inverse spectral transform to the compensation spectralresponse. However, reducing the filter length will inevitably effect itsspectral response, and may re-introduce some response in the lowerfrequency region which the lower rate filters are to compensate.

In fact, the low frequency cut within the target response for the highfrequency filter is relatively gentle and so in any event the high ratefilter may have a substantial response in the low and mid-rate regions.

In order to take account of the high rate filter response in lowerfrequency ranges, the spectrum of the actual high rate filter responseis obtained by a further Fourier transform, and corresponding frequencyterms are aligned or matched to those of the low rate compensationresponse prior to deriving the low rate compensation filter.

The values of coefficients of the high rate filter response spectrumwhich fall within the pass band of the low rate response spectrum arethen subtracted from their low rate equivalents, so that the low ratefilter excludes the filtering already performed by the high rate filter.The similarity with the method used to deprive the filter of theembodiment of FIG. 12 will be apparent.

After this, the coefficients of the low rate filter are derived, e.g. byinverse Fourier transform. Where three or more filter responses indifferent bands are calculated, as shown in FIG. 16c, the correspondingportions of the spectral correction response obtained for each filter issubtracted from that of every filter operating at a lower rate; in otherwords, the spectral response of the derived high rate filter issubtracted from the spectral response of the calculated mid-bandcompensation, from which the response for the mid-band compensationfilter is calculated. The spectral responses of the mid-bandcompensation filter and the high band compensation filter in the lowband frequency region are both subtracted from the calculatedcompensation response for the low frequency band filter, and from theresult the low rate compensation filter is calculated.

For completeness, FIG. 17 illustrates one way in which, for example, theloudspeaker response may be derived. The full band rate signal isFourier transformed, with an initial windowing operation using asuitable flat topped window to prevent frequency leakage, then dividedinto the high frequency target which comprises a predetermined responsecalculated, firstly, to prevent compensation for the low passanti-aliasing and sampling filtering present in the measuring equipment,and secondly, to impose a gentle low frequency cut at below the upperfrequency limit of the mid-rate filter, e.g. 4 kHz.

The compensation filter thus derived is inverse Fourier transformed, andthe resulting impulse response is windowed once more to limit the filterlength to a practical value (e.g. 75 samples). The measured signal isalso decimated by a factor of, for example, three to calculate themid-rate filter coefficients. The decimated signal is windowed andFourier transformed as before. Since the decimation has band limited thespectrum, it is merged at around its Nyquist frequency with thecorresponding portion of the high rate spectrum previously derived. Theresulting merged spectrum is divided into the mid-frequency target,which includes a low frequency cut below the upper frequency limit ofthe low rate filter at, for example, 900 Hz.

As discussed above with reference to FIGS. 16B and C, the spectrum ofthe actual high rate filter is derived by a Fourier transform andsubtracted from the mid-frequency compensation spectrum, and the resultis inverse Fourier transformed and windowed to yield the coefficients ofthe mid-rate filter 58.

The measured signal is decimated further to provide a low rate signal,which, as before, is windowed and Fourier transformed. To correct theerror around the Nyquist frequency, the spectrum thus derived is mergedwith the corresponding portion of the mid-frequency spectrum previouslyderived, and the result is divided into the low frequency targetspectrum. The resulting calculated compensation spectrum has subtractedfrom it the spectra of the actual high and mid-rate filters 59 and 58,and the resulting corrected spectrum is inverse Fourier transformed andwindowed to yield the coefficients of the low rate filter 55.

This process can be adapted in several ways; for example, the mid-ratefilter could be derived without decimation from the full rate signal, inwhich case, as shown in FIG. 18, the corresponding coefficients of thehigh frequency filter can be subtracted from those of the full rateimpluse response derived by inverse Fourier transforming themid-frequency correction response. This time domain subtraction servesto prevent the mid-range filter correcting agin those aspects of themid-range response already taken account of by the high rate filter. Themid-range characteristic of the high range filter. To obtaincoefficients of a filter to work at the lower sample rate required ofthe mid-rate filter 58, this impulse response is then decimated (e.g. bya factor of three). Further windowing to reduce this length of theimpulse response may be performed.

The same process could of course by analogy be employed to derive thelow rate filter 55 taking account of the mid-rate filter 58.

In calculating the room response, the measured signals from eachmicrophone position are separately windowed and transformed (withdecimation as necessary), and the spectra averaged, prior to thesubsequent stages of FIGS. 17 or 18. At this stage, the correspondingband response for the loudspeaker is divided out to give the response ofthe room.

Compensating Source Phase Errors

The electrical source signal supplied to the filter 5 is, as discussedwith reference to FIG. 1B, usually the result of an original audiosource signal S processed by electrical circuitry such as amplifiers,filters, transformers and so on having an overall transfer functionF_(s). Since the original audio source signal itself is not available,it is not in general possible to identify the source signal and thetransfer function F_(s) separately.

A modern high fidelity sound recording may have passed through manystages of processing, including AC couplings and each will include e.g.RC high pass circuits. At low frequencies, the phase leads induced bythese filters can lead to noticable phase distortion. Because theoriginal source signal is not available, the co-efficient calculator 6cannot automatically compensate the effect of these phase errors. It isalso not possible to compensate for such phase leads using a passiveanalogue filter as an acausal filter is necessary: this can however beprovided by a digital filter including a bulk delay or an FIR filter.

In a preferred embodiment of the invention we provide an all pass filterselectable by the user to compensate these phase errors; this can beachieved with a filter having a simple response in which the phase isresponsive (at least roughly) to 1/f over bass frequencies. The constantof proportionality is selected by the user, for example by a separatelyprovided phase control on the filter 5 housing.

It can be shown that over mid-bass frequencies, the effect of cascadedRC high pass elements can approximately be compensated by a filterhaving a transfer function of the form e^(-ik/w), where K is a constantthat can be adjusted by the listener for an optimum setting, and W isangular frequency in radians. The group delay of such a filter equals-K/W², representing a time advance which becomes larger without limit atvery low frequencies. To implement this directly would require infiniteprocessing delay, so the correction is implemented in a modified formhaving substantially the correct form over the audible frequency range(above around 16 Hz).

One such approach is as follows:

The Bessel filter 1/B (s) is an n-th order low-pass filter whose phaseresponse is a maximally flat approximation to unit delay. Hence B_(n)(-s/2)/B_(n) (s/2) is a n-th order all-pass with the same property.Hence B_(n) (K/(2s))/B_(n) (-K/(2s)) is an n-th order acausal all passwhose phase response is a maximally flat approximation to -K/w for largew.

One could therefore calculate the corresponding function of w (s=iw) inthe frequency domain and take the Fourier transform to obtain thecorresponding impulse response. This will be acausal but will containreverse-time exponential tails that die away at a reasonable rate, sothat an available pre-response of, say 0.25 sec would be adequate.

A disadvantage of this technique is that all coefficients of thetransversal filter need to be re-calculated each time the user demands anew value of K, and this makes "continuous" manual adjustment inresponse to a knob very difficult.

To overcome this difficulty, one can determine K_(max), the maximumvalue of K likely to be needed, implement a corresponding acausalresponse as a transversal filter 62a, then subtract off the unwantedphase-shift corresponding to K_(max) -K by means of a causal all-passfilter 62b, which can be implemented recursively and easily adjusted.The transversal filter 62a implements B_(n) (K_(max) /(2s)/B_(n)(-K_(max) /(2s)) (acausal all-pass) and the recursive all-pass filter62b implements B_(n) (-(K_(max) -K)/(2s))/B_(n) ((K_(max) -K)/(2s))(causal).

This structure is illustrated schematically in FIG. 19; the transversalfilter coefficients will in practice be predetermined and will form partof the filter 5, whereas the coefficients of the causal infinite impulseresponse filter (typically a third order filter) are swiftly calculatedin real time by the coefficient calculator 6 in response to variation ofthe value of K supplied as a control signal by a phase control knoboperated by a listener. FIG. 20 illustrates the disposition of the phasecontrol filter 62 in the embodiment of FIG. 12. Note that, in this case,the delay path 57 is required explicitly to be present.

Several pre-set K_(max) values may be supplied, allowing the user toselect different ranges of correction.

As stated above, it is preferred that the phase response of thecompensation filter should be inversely proportional to frequency in themid and bass frequency region. However, departures from thisproportionality are acceptable. In fact, the phase response ofloudspeakers in the bass region is generally not exactly proportional to1/f, but often departs from such exact proportionality by a phase angleof a few degrees, so that corresponding variations in the correction offilter are of no importance.

It may also be desirable, for other reasons, to provide a filter whichapproximates the inversely proportional phase response but hasexcursions or ripples therefrom. For example, as will later bediscussed, it is desirable in many applications (such as audio visualreproduction, where synchronisation with a video signal must bemaintained) to avoid long bulk delays in the audio reproduction chain.However, to precisely specify the phase response of the filter to a goodapproximation to the desired inversely proportional frequencyrelationship requires a large number of filter stages and hence, sincethe phase correction filter is acausal, a long preresponse andcorresponding filter delay, perhaps as high as several hundredmilliseconds. Accordingly, in applications (such as audio visualreproduction) where it is desirable to avoid lengthy delays, a filterdeviating from proportionality but having a lower filter preresponse andhence delay is provided, in one embodiment of the invention.

One particularly preferred type of such filter has a phase responsewhich closely approximates inverse proportionality to frequency over themid-bass frequency ranges, but deviates therefrom by progressivelyincreasing deviations at progressively lower frequencies; the filter isthus linear over the audio range where bass phase errors areparticularly noticeable (around 200 or 300 Hz).

Some discussion of the suitable filters and of their derivation will nowbe given.

One example of a phase compensation or correction filter has theresponse (g-z)/(1-gz), where, as conventional, z⁻¹ indicates the unitsample delay. This filter defines an acausal all pass network if themagnitude of g is less than 1, and its phase behaviour compensates thephase response of, for example, a loudspeaker having a low frequencyroll off at 12 dB per octave below its bass cut off frequency and aphase response corresponding to that of the all pass filter(g-z⁻¹)/(1-gz⁻¹).

This correction filter can be implemented with an impulse response of arealistic length if impulse response terms at a sufficiently low level(for example, below -100 dB) are omitted. Where this figure is taken,the preresponse length of the filter is 11.5/(1-g) samples.

The phase response of the acausal filter (g-z)/(1-gz) is not exactlyinversely proportional to 1/f at frequencies above the cut off frequencyof the loudspeaker. For g very close to 1 in value, the phase responseof the acausal phase compensation filter approximates that of-(1+jwr)/(1-jwr) where w is angular frequency and τ is the time constant(equal to 1/(1-g) samples) of the filter, which has a phase response, atangular frequency w, of 2cot⁻¹ (wτ)=2wτ (radians) at higher frequencies.However, for wτ=1, 2 cot⁻¹ (1)=2πK/4=1.57 radians which deviates fromthe ideal 2/wπ by 0.43 radians. For wτ=2, 2 cot⁻¹ (wτ)-2/wτ=-0.073radians=-4.17°. Thus the deviation from the ideal inverse frequency lawis less than 0.1 radian above about twice the cut off frequency of theloudspeaker, (typically above about 70 Hz), the deviation reducingrapidly with increasing frequency.

Although the acausal phase compensation filter (g-z)/(1-gz) has ashorter preresponse (of 11.5τ) than filters that more exactly compensatefor a phase response proportional to 1/f, it is also possible to usemore elaborate acausal phase compensation filters with an even shorterpreresponse of around 3τ or 4τ (corresponding typically to a preresponseof around 10 or 15 msec for a loudspeaker cut off frequency of 50 Hz).

Referring to FIG. 37a, the impulse response of the bass phase correctionfilter described above therefore corresponds generally to a timereversed version of the all pass (i.e. phase only) part of the Besselcorrection filter described above, and thus has the general form of anexponential attack of infinite length prior to the "t=0" or main term ofthe impulse response. Truncating this infinite preresponse would lead toripples in the phase response, but would also lead to ripples in theamplitude response so that the filter would no longer be an all passfilter. However, as noted above, truncation of extremely low magnitudeterms in the impulse response is generally acoustically acceptable.

In a preferred embodiment, however, we provide a new method oftruncating the preresponse of an all pass correction filter of thistype, whilst still maintaining its amplitude response intact. Thisenables the realisation of a filter having a shorter bulk delay (i.e.preresponse). This is achieved by employing a filter which correspondsto a cascade of the above described filter and a further all pass filterwhich has the effect of truncating the preresponse; since both filtersare all pass, the filter corresponding to their cascade must also be allpass and hence distortion of the amplitude response is avoided.

A first, relatively crude, method of doing so employs a causal all passtruncation filter as follows:

    (g-z)(1-g.sup.n z.sup.n)z.sup.-n /(1-gz)(1-g.sup.n z.sup.-n)=(z.sup.-n -g.sup.n)(g-z)/(1-g.sup.n z.sup.-n)/(1-gz)

where the value of n is selected such that g^(n) is small (say <0.1),the term (1-g^(n) z^(n)) is factorable, using simple arithmetic, by theterm (1-gZ), so that the combined filter response is:

    z.sup.-n (g-z)(1+gz+g.sup.2 z.sup.2 +. . . +g.sup.n-1 z.sup.n-1)/(1-g.sup.n z.sup.-n)

In this filter, the denominator is causal and so is the numerator. Theimpulse response of this filter is indicated in FIG. 37b, and thepreresponse will be seen to be truncated to n samples. As a consequenceof the truncation, low level spaced components in the post response areintroduced; these render the post response portion of the impulseresponse considerably longer, but do not thereby extend the bulk delayof the filter (which is dictated by the preresponse) and can in practicereadily be realised using a simple recursive filter structure.

The factor (z^(-n) -g^(n))/(1-g^(n) z^(-n)) =z^(-n) (1-g^(n)z^(n))/(1-g^(n) z^(-n)) produces an overall time delay z^(-n) of nsamples, plus phase deviations of order ±2g^(n) radians for small valuesof n, since the numerator and denominator can both be in error by up to±g^(n) radians.

A preferred implementation of this filter provides a finite impulseresponse filter for implementing the numerator (providing the bulk delaynecessary for realising the preresponse) and a recursive filter forrealising the denominator, the two filters being cascaded in series; asdescribed above, the recursive filter coefficients may be varied in useto vary the phase correction.

Whilst this technique of reducing the preresponse does so withoutchanging the amplitude response of the filter, in some applications thesharp step in the impulse response may, as noted elsewhere in thispatent, be psychoacaustically audible. Accordingly, a more preferredembodiment which avoids this will now be described.

Referring to FIG. 37c, a smooth transition in impulse response betweenthe value at a sample -n of the response of FIG. 37a and 0 at somesample -(m+n) may be produced by averaging the n+1 impulse responsescorresponding to those which would be produced by truncating the impulseresponse of FIG. 37a by multiplying by a truncating all pass filter ofthe above type in which n is replaced by (n+i), where i is each integerfrom 0 to m. It would in principle be possible to provide a bank offilters, each truncating the impulse response at a value one sampledifferent to the others, between (-n) and -(n+n), and summing theiroutputs. However, the same effect is achieved by employing a morecomplex causal all pass truncation filter: ##EQU3##

The coefficients a_(j) are normalised to sum to unity, so that thenumerator is divisible by (1-gz); in one example, all values of a_(j)are equal to 1/(m+1), which provides a smooth attack in the preresponseas illustrated in FIG. 37c.

In this particular example the phase ripple resulting is due to thefactor: ##EQU4## and consequently decreases with frequency.

In general, it is found that acausal phase compensation can acceptablydeviate from being proportional to 1/f within the audio band if thedeviation is less than about 0.1 radians above a frequency correspondingto about twice the loudspeaker bass cut off frequency, and if the phasedeviation decreases within increasing frequency f more rapidly than 1/f(or, in general, some constant times 1/f).

Referring to FIG. 37c, in practice, the values of n and m may beselected such that m=n/2, or thereabouts, to give a fairly rapid butsmooth fade in to the impulse response. The selection of the values ofg, n and m is determined in part by the maximum acceptable bulk delay(n+m) and in part by the maximum acceptable phase ripples. Recallingthat τ, the time constant of the all pass acausal filter the preresponseof which (shown in FIG. 37a) is to be truncated, is equal to 1/(1-g),if, for example, g=0.05 then n+m=4.5τ.

The above described technique of taking a first filter having apredetermined amplitude and phase response and exhibiting an impulseresponse with a substantial preresponse, and then generating therefrom asecond filter having an abbreviated preresponse but exhibiting the sameamplitude response (at the cost of some phase distortion), bymultiplying the first filter by a causal all pass network, can beextended to other problems than the present described context ofloudspeaker compensation. In general, the inventive technique of sodoing comprises providing that the numerator of the truncating all passfilter is such that it can be factored exactly by the denominator of thefirst filter of the impulse response for which it is desired totruncate. This can be expressed in general as: ##EQU5## where P_(k) andQ_(n+m) are polynomials of degrees k and n+m respectively. The firstfactor is a time reversed (and hence acausal) kth order all pass whosephase response is designed to be broadly proportional to 1/f in theaudio band above the loudspeaker cut off frequency, and the secondfactor is an (n+m)th order causal all pass network whose responsecomprises an impulse of amplitude near unity plus relatively low levelpre- and post-response tails, such that P_(k) (z⁻¹) factors Q_(n+m)(z)z^(-m-n) exactly. In general, the first factor (P_(k) (z)/(-z) P_(k)(z⁻¹) may be factored into k terms of the form (g_(j) -z)/(1-g_(j)z_(j)) (j=1 to k) where g_(j) is a complex valued factor, and the secondfactor may be factored into k terms of the form: ##EQU6## for j=1 to k,where for each j, ##EQU7## and where n₁ +. . . n_(k) =n

m₁ +. . . m_(k) =m

where n+m samples is the total latency or preresponse of the overallproduct.

Thus in general, a complex kth order acausal all pass response P_(k)(z)/(-z)^(k) P_(k) (z⁻¹) may have its preresponse truncated bymultiplying by an all pass factor which is the product of k causal allpass factors each having the effect of truncating one of the k firstorder factors of (13) that kth order all pass response.

Such a modified all pass compensation, having a limited preresponse andlatency, deviates from the ideal phase response proportional to 1/f to alimited degree, but still maintains the substantial benefits of a phasecompensation proportional to 1/f.

By reducing preresponse, and hence latency, to a figure preferably below50 ms, the effect of time delays causing loss of synchronisation betweensound and an associated picture can be minimised without using a framestore or similar time delays for the picture. Also, in studio monitoringapplications, the effect of any modification of a sound can be heardwithout an excessive time delay between adjusting a control and hearingits effect.

Filter Power Limiter

It is of considerable importance that it should be impossible for thefilter 5 to boost bass frequencies to a level where they might overloadand ultimately damage a loudspeaker. To ensure that this is impossible,a preferred embodiment of the invention includes a power limiter stage63 following the filter 5. Where a separate low frequency equalizerfilter 55 is provided, as shown in FIG. 20, the limiter 63 is providedfollowing the filter 55.

Referring to FIG. 21, the limiter 63 acts as a variable gain in thefiltered signal path, the gain being unity for acceptable signalamplitudes. For signal amplitudes which are considered unacceptable,beyond a predetermined maximum threshold, the gain is such that thesignal is attenuated. The limiter could merely comprise a clippingarrangement, but it is preferred to provide a transfer characteristic ofthe form shown in FIG. 21, with a gain of unity and a smooth transitionabove a first threshold T1 to a flat characteristic at a secondthreshold T2. This reduces the unacceptability of distortion introducedby the limiter 63.

Rather than using a limiter responsive to the instantaneous level of thesignal, a variable gain control circuit responsive to the signalenvelope level may be employed, giving lower distortion.

Test Signal

The operation of the test signal generator 8 in a preferred embodimentwill now be discussed. In principle, the test signal generator 8 couldgenerate any type of signal having a predetermined response or transferfunction, and the response measured at the microphone 7 could be dividedby the signal response to yield the response of the loudspeaker/roompath. However, processing is naturally much simpler if the response ofthe test signal generated by the test signal generator 8 is unity, i.e.evenly distributed across the frequency spectrum.

Considering the problem in the time domain, the simplest test signal isa single impulse; this enables the impulse response of the signal pathto be measured directly. However, since the effect of the path is todistribute the energy of the impulse over a considerable time (up toseveral seconds), the amplitude of the test impulse needs to beextremely high which is undesirable with real amplifiers andloudspeakers. Alternative test signals which have greater energy but asimilar frequency spectrum have been developed; various types ofpseudo-random sequences are known on the one hand, and on the other handit is known to use a so called "chirp" signal comprising a continuoussignal with linearly rising frequency, of the general form cos/sin(2πKt²) as shown in FIG. 22a and 22b. At an instant t the instantaneousfrequency of this signal is 2K.

Because the reverberation period of the room can be long, it isnecessary to wait for a settling period after the frequency sweep hasfinished to make sure that the room response has died down beforecommencing a second sweep. Typically, the waiting period can be as longas seven times the length of the frequency sweep period. This discretefrequency sweep signal is therefore not ideal since considerable time iswasted or, viewed in another way, the energy of the signal is againdissipated over a long period.

An alternative to a discrete frequency sweep would be to provide asignal which swept up in frequency and then down again continuously asshown in FIG. 22c. One simple method of doing so would be by using acontinuously increasing frequency sweep of the form cos (or sin) (πt²/n), in a sampled system where time is sampled in steps of unity.Aliasing will occur commencing at t=n/2, after which the instantaneousfrequency falls again to reach zero at t=n as shown in FIG. 22d.

A problem with each of these types of chirp test signal is that toderive the complex Fourier transform required for a complete amplitudeand phase description of the system response, it would be necessary togenerate a complex test signal e.sup.πit2/n. Unfortunately, this is notphysically possible; one must use either a sine or cosine signal andprocess the measured response appropriately.

Preferably, therefore, the test signal generator according to thepresent invention in one aspect generates a test signal of the form cos(or sin) (πt² /n+πt/2n) as shown in FIGS. 22e and 22f. It is easilyshown that at t=0, this signal has a frequency 1/4n and a phase of zero.At t=n, the frequency again is 1/4n, but the phase is π/2. In general,the second n samples are a repeat of the first but with a phase shift of90° and the third n samples are a repeat of the first but with a phaseshift of 180°. The fourth block has a phase shift of 270°, and the fifthblock of n samples repeats the first.

This test signal therefore provides two quadrature (i.e. sine andcosine) components from which the complex Fourier spectrum can bereproduced, but does so without a discontinuity so that it isunnecessary to wait to allow reverberations to die away in between thetwo quadrature components.

Another advantage is that since the signal over the third block of nsamples is the phase reversed version of the signal over the first blockof n samples, subtracting the corresponding blocks of measured signalsamples will double the value of measured signal components but anysecond order non-linearities (produced, for example, by loudspeakeroverloading at low frequencies due to the voice coil travelling outsidethe magnetic gap or rectification effects) will be cancelled out. It isalso demonstrable that by similar processing the effects of third andfourth order harmonic distortion can be reduced.

In general, the effects of high order harmonic distortion can be reducedby using a test signal of the form:

    cos (πt.sup.2 /n+2πt/qn+φ),

where φ is any constant phase offset, and q is the order of the harmonicto be cancelled and applying appropriate processing to the receivedsignal. Still more generally, the term 1/q may be replaced by p/q, wherep and q are relatively prime integers.

An alternative signal having a similar effect has the form cos (πt²*m/n), where m is an integer relatively prime to n. Suppose, forexample, n=1024 and m=5, the rate of increase of frequency will be fivetimes as fast as that of the signal of FIGS. 22a and 22b. At t=0, thesignal frequency is zero, but because m is not divisible into n, thenext point at which the signal passes through zero would occur after anon integer number of samples (204.8). Even interpolating between samplepoint 204 and 205, the phase has not returned to zero. In fact, althoughthe frequency appears to repeat after 204.8 samples, the phase does notrepeat until 1024 samples. Because the low frequency energy of thesignal is distributed over time compared to that of FIG. 22a, there isless low frequency non linear distortion.

Particularly useful values of m/n are those which are furthest frombeing simple ratios (in other words are highly incommensurable); the socalled "golden ratio" is one example of such a ratio, and others areobtained from successive terms of a Fibonacci series. Such ratios giverise to a test signal which approaches the properties of a pseudo randomsignal, which minimises the non linear distortion problem referred toabove.

Referring to FIG. 23, one way of providing a test signal generator 8 isto provide, in successive addresses of a read only memory (ROM) 8a, thesuccessive signal values stored in digital form to be output assuccessive time samples. The data bus of the ROM 8a is connected to thedigital output bus of the signal generator 8, and the address bus of theROM 8a is accessed by the output of an up-counter circuit 8b clocked bythe system clock 8c so as to access successively higher addresses withinthe ROM 8a. It is unnecessary in practice to provide the counter circuit8b and clock 8c as separate circuit components; they preferably form apart of any suitable digital processor such as that which performs thedigital filtering, operating under a suitable stored program. Similarlythe ROM 8a may form a partitioned area of a general purpose storagedevice within the apparatus.

The above types of test signal are examples of a more general type oftest signal according to an aspect of the invention. In the above testsignals, a signal is generated which has a periodically varyingfrequency and a periodically phase, and the phase repetition periodexceeds the frequency repetition period so that the coefficientcalculator 6 can refer to several measured signal portions which containcorresponding frequency information, but are shifted one relative to theother by predetermined phase increments. It will be clear that there isin fact no need for the signal to have a periodically varying frequency,provided the signal is broad band (i.e. includes frequency componentsacross the range of interest) and is periodically repeated; the abovechirp signals are special cases of this general class of signals.

Accordingly, in this aspect, referring to FIGS. 38 and 39 the generator8 comprises means 8d for generating a reference test signal which isbroad band and means 8e for producing a time dependant phase shift ofthe test signal 8d. The means 8d, 8e, could, of course, be realised by asingle look up table embodying successive values of the phase shiftedreference signal, as is provided in FIG. 23.

The reference test signal generated by the signal generator 8d could, asabove noted, be a chirp signal (i.e. a signal with a periodicallyvarying frequency), or it could be a Gaussian random signal or someother white noise signal, or it could be a single impulse; moreover,although these examples all have relatively constant amplitude frequencycomponents, it could be any other signal provided that it includesfrequency components of known amplitudes across the frequency band whichthe calculator 6 is to operate. The reference signal generator 8d mayproduce a digital or analog output.

Referring to FIG. 39, the phase shifter 8e may comprise means 8f, 8g forgenerating a pair of signals having a phase angle of 90 degrees betweenthem, and means (8h,8i,8j) for performing a time varying rotationtransformation on the signals, by multiplying one by a time varying sineterm and the other by a corresponding time varying cosine term,andsumming the two at an adder 8j. It will usually be convenient that theconstant phase term "θ" may be 0, so that one of the signals produced bythe means 8f, 8g corresponds to the original signal from the signalgenerator 8d.

If the signal from the signal generator 8d comprises an analog signal,the means 8f, 8g may comprise a pair of analog phase shift networkshaving outputs mutually in quadrature; such networks generally have afrequency dependency, which is dealt with (reversed) by the reversephase shifter 6a.

If the output of the signal generator 8d comprises a series of digitalsamples, and the signal generator 8 includes a store dimensioned to holdsamples for one period of the reference signal, the phase shift means 8fmay comprise digital means for performing a Hilbert tranform to generatethe phase shifted signal therefrom.

Referring to FIG. 40, the reverse phase shifter 6a may comprise means6d, 6e for generating a pair of output signals in quadrature; as withthe phase shifter 8e, one of the output signals may correspond to thesignal received from the system under test, or alternatively there maybe a constant phase shift θ common to both outputs (which need not bethe same as the constant phase shift, if any, introduced by the means8g, 8f in the phaser shifter 8e).

The reverse phase shifter 6a conveniently comprises means 6f, 6g forproducing a pair of quadrature phase shifted output signals,corresponding to the equivalent means 8f, 8g employed in the signalgenerator 8, and cosine and sine generators 6h-6k by which the outputsof the phase shift means 6f,6g are multiplied to generate, as outputs6d, 6e, a pair of orthogonally reverse phase shifted signals, with phaseshifts (-φ(t)), (90-φ(t)).

The sine and cosine function generators 8h, 8i, 6h-6k may allconveniently be provided as look up tables, addressed by a clock signalas shown in FIG. 23, so as to produce time varying digital outputsignals which are then multiplied by the signals from the phase shiftmeans 6f, 6g or 8f, 8g.

The averager 6b comprises means for storing signal samples from thereverse phase shifter 6a which correspond to a complete repetitionperiod of the reference signal generated by the signal generator 8d.Referring to FIG. 39, after a complete cycle or period of the referencesignal has been applied to the system under test, at least one furthersuch period is then generated; although the reference signal produced bythe signal generator 8d is the same, it will have a different phaseshift due to the phase shifter 8e. The samples corresponding to thesecond period, and as many further periods are required, are thenlikewise stored by the averager 6b.

Once the required number of periods of the reference signal arecompleted, the corresponding samples in each stored portion are averagedto form an average stored portion. For instance, the first sample storedfrom the first stored period of the reference signal may be added to thefirst sample stored for the second stored period of the reference signaland to the first sample stored for each further stored period, so as toderive an arithmetic mean value over different phase shifts for thefirst sample, and likewise to derive averaged sample values for the restof the reference signal cycle from the time aligned samples of thefirst, second and further stored portions.

In fact, it may be convenient to form a running average or a sum, byadding each reverse phase shifted sample to a corresponding stored valuefrom previous reference signal periods, so that the averager 6b needsonly contain storage means dimensioned to hold samples for a singalreference signal cycle. Equally, however, other types of average thanthe arithmatic mean could be employed.

In a particularly preferred embodiment, the function φ(t) is selectedsuch that the phase shift repeats after an integer number of cycles ofthe reference signal generated by the reference signal generator 8d;where the phase returns to its initial value after a number q of cycles,so that φ=A+2πpt/nq, the test signal generator 6 is arranged to generateq cycles (or an integer multiple thereof) and the averager 6b isarranged to generate sequence of averaged sample values from acorresponding number of cycles.

It can therefore be seen that each averaged sample produced by theaverager 6b corresponds to the corresponding point in the referencesignal, passed through the system under test, averaged over phase shiftsof φ, φ+2π/q, φ+4π/q . . . φ+2πr/q.

This can be shown to cancel second and higher order harmonics, inexactly the same way as the above described frequency swept chirp signal(which is a particular case of this aspect of the invention).

An explanation of how this beneficial distortion cancellation takesplace is most easily described in the frequency or Fourier domain. Forconvenience, if n=1 second and q=10, the reference signal output by thesignal generator 8d comprises, as shown in FIG. 41a, harmonics at 1 Hz,2 Hz . . . FIG. 41b shows that, if the orthogonally phase shiftedoutputs of the phase shift means 8f, 8g are considered as real andimaginary parts of a complex signal ("analytical signal"), the negativefrequency components of the line spectrum are thus removed.

Since the phase shift produced by the phase shifter 8e repeats every 10cycles (i.e. every 10 seconds) and the phase shift produced by themultiplications with the sine and cosine values produced by sine andcosine multipliers 8h, 8i give a progressive phase advance, the timevarying phase shifts correspond to a frequency offset of 0.1 Hz.Therefore, as shown in FIG. 41c, the complex output phase of the sineand cosine multipliers would be a phase shifted signal having onlypositive frequency components. However, since the sine and cosinecomponents are added together at the adder 8j to produce a real result,the signal actually applied to the system under test is, as shown inFIG. 41d, a signal having positive and negative frequency componentslines at frequencies of +/- (n+0.1 Hz).

If the system under test introduces harmonic distortion into the testsignal, the result is shown in FIG. 41e; the line at 0.1 Hz hasharmonics at 0.2 Hz and 0.3 Hz, etc; the line at 1.1 Hz gives rise toharmonics at 2.2 Hz, 3.3 Hz, 4.4 Hz etc; the line at 2.1 gives rise toharmonics 4.2, 6.3 Hz etc, and so on. Thus, it will be seen that theeffect of applying the phase shift to the reference signal is togenerate a signal in which the line spectrum components are no longerharmonically related, so that the harmonics introduced by distortion canbe separated in the frequency domain from the line spectrum of the testsignal.

Referring to FIG. 41f, if the two quadrature outputs 6d, 6e are taken asthe real and imaginary components of a complex measured signal, theeffect is once more to suppress negative frequency components. Theeffect of the reverse phase shift here is to shift down the frequenciesof all components by 0.1 Hz, so that the spectral lines of the referencesignal have returned to 0, 1, 2, . . . Hz and the distortion harmonicsare now at 0.1, 0.2 . . . , 2.1, 3.2 . . . Hz etc. Finally, theaveraging process performed by the averager 6c eliminates all components(e.g. the distortion introduced harmonics) except those at an integermultiple of 1 Hz. The averaged signal samples can then be used to findthe impulse response of the system under test, in the same manner asdescribed above, except that account must be taken of the fact that theaveraged signal frequency content has been shifted down 0.1 Hz relativeto the signal supplied to the system under test.

For example, if the analyser 6c performs a Fourier transform on thestored averaged signal samples, the signal values at 0, 1, 2, 3 . . . Hzare generated by interpolation from the peaks derived from thetransform, which actually relate to test signal frequencies of 0.1, 1.1,2.1 . . . Hz.

The transform coefficients thus derived are then divided by the (known)coefficients corresponding to the Fourier transform of the referencesignal, so as to deconvolve the impulse response of the reference signaland leave that of the system under test.

Various further modifications to the above described technique can bemade. For example, although it is preferred that the phase variationφ(t) is linear (or at least monotonic) with time, other functions couldbe employed although less smooth functions (for example including steps)inevitably lead to some extent to generation of false frequencies.

Further, the phase repetition period need not be an exact multiple ofthe period of the reference signal; if it is not, then the averagor 6bis arranged to perform "ergodic" averaging over a sufficiently largenumber of reference signal repetition cycles. The averaging means 6c, inthis embodiment, is arranged to apply a windowing function to thesamples prior to averaging, so as to weight each sample by a windowingconstant; the shape of the windowing function is preferably selectedsuch that the sum of the windowing constants applied to the sampleswhich are averaged together to produce a single averaged sample isunity. Considering the received signal samples over the whole pluralityof reference signal cycles, the shape of the windowing function ispreferably a smooth curve tapering to 0 at either end and rising to amaximum towards the middle; one example of a windowing function whichsatisfies this is a B-spline of higher order (for example a cubicspline), having curve control points ("knots") equally spaced at adistance n samples (where n is the number of reference signal repetitionperiods) from each other, convolved with a rectangle function.

Rather than performing the above described averaging, it would inprinciple be possible to separate the distortion harmonics from the testsignal harmonics by employing a comb filter or the like.

MULTIPLE SPEAKER SYSTEMS

In the preceding description, the problem of equalising one loudspeakerin an acoustic environment has been described. However, at present manyaudio reproduction systems provide two speakers 1a, 1b, whether or notthe source material is also provided in stereo, and it has been proposedto use a larger number of speakers (for example, quadrophonic systemsemploying four speakers) to enhance the sound image.

If a separate equaliser filter is derived for each loudspeaker/acousticenvironment path, then it is likely that the overall delay in thefilters will differ such that the sound from different speakers willarrive at the compensated zone at different times, creating anundesirable echo and disrupting the stereo effect. Some form ofequalisation for each loudspeaker which takes account of theequalisation for other loudspeakers is therefore desirable.

Delay Equalisation

In one embodiment shown in FIGS. 24 and 25a, this is provided byderiving, as above, a separate compensating filter 5a, 5b for eachloudspeaker/environment path, and introducing into the signal path puredelay stages 70a, 70b calculated so as to align the time of arrival ofthe initial transients of sound from each loudspeaker within thecompensated zone.

Calculating such a delay may be done, for example, by providing a testsignal from each loudspeaker 1a, 1b separately and timing the delay overeach path to the microphone 7; calculating the difference in timesbetween the longest and the or each shorter time; and providing in thecompensating filter for the or each loudspeaker 1a, 1b which gave ashorter arrival time a delay stage 70a, 70b corresponding to its timedifference.

Since the compensation of the acoustic environment 2 is not linearphase, the group delay will differ with the acoustic signal frequency.Although a single delay stage is reasonably effective in restoring thestereo effect, the problem is not entirely eliminated because, since thecompensation of the acoustic environment 2 is not linear phase, thegroup delay varies with signal frequency.

For stereo systems, it is strongly preferred that the acousticenvironment compensation stage should have a limited pre-response, sincethis should make the phase response of the entire signal path somewhatmore linear with frequency and, since the signal paths from the twoloudspeakers deviate less from an ideal response, they will be moresimilar to each other than if minimum phase compensation for theacoustic environment were used.

In an alternative, and preferably additional, step, the delays 70a, 70bare arranged to have a frequency dependency so as to give substantiallyequal arrival times to signals from the two loudspeakers 1a, 1birrespective of signal frequency. This does not imply that the signalpath from each loudspeaker to the listener position 3 is itself linearphase; merely that the degree of deviation from linear phase isessentially the same for each path.

The group delay as a function of frequency may simply be determined bypassing a plurality of test signals of different frequencies through thecombination of the filter 5, loudspeaker 1 and acoustic environment 2 tothe microphone 7, and measuring the time of flight of each signal ateach frequency for each loudspeaker. Alternatively, a frequency swepttest signal of the kind discussed above may be employed. The group delayis preferably derived over relatively broad frequency intervals; forexample, one group delay value for each 1/3 of an octave.

Having derived the group delay at a number of frequencies for eachloudspeaker, the corresponding delays for the loudspeakers aresubtracted for each frequency to give the inter-channel delay as afunction of frequency. The filter calculator 6 then calculates theparameters of an all pass filter having a group delay against frequencyresponse such as to substantially equalize the inter-channel delay, andthe delay 70a or 70b is replaced by an all pass filter exhibiting thisbehaviour.

Matrix Compensating Filters

Referring to FIG. 24, with polyphonic (e.g. stereo) source material, thedesired effect is that, for a human head at a listening point 3 in anacoustic environment, each ear should receive a predetermined amount ofsignal from each loudspeaker 1a, 1b, the predetermined portion for theleft ear of the left hand loudspeaker should be greater than that forthe right ear, and vice versa.

The presence of the acoustic environment 2 can however upset theproportions of the signals from the respective loudspeakers which reacheach ear and thus the stereo sound image perceived by the listener. Thiscan be compensated by providing, in addition to compensating filters ineach of the loudspeaker paths, filters 50a, 50b linking the twoloudspeaker paths so as to provide to each loudspeaker 1a, 1b a filteredproportion of the signal from the other loudspeaker path as shown inFIG. 26.

It may be convenient to position the filters 50a, 50b to filter theoutputs of the filters 5a, 5b so that it is unnecessary to include inthe filters 50a, 50b any substantial element of loudspeaker correction(assuming the loudspeakers 1a and 1b to be matched, as is usual. Thecombined filtering system 5a, 5b, 50a, 50b, may however be viewed as amatrix filter having two inputs and two outputs.

Reverberation Reduction

A known technique of noise cancellation employs a loudspeaker and amicrophone positioned in close proximity. The microphone receives soundrepresenting the sound incident upon the loudspeaker, and a processingor filtering circuit produces a signal supplied to the loudspeaker whichis in antiphase to the signal incident upon the microphone, so that theloudspeaker signal cancels the incident signal. This cancellation iseffective over an area or volume around the loudspeaker. This effectcould be used to reduce reverberations in acoustic environment, wherethe loudspeaker is positioned at a reflecting surface so that anincident wave is cancelled rather then being reflected.

We have realised, that in such an application, a separate microphone isunnecessary in use since the signal incident upon the loudspeaker is inessence the source signal filtered by the response of the acousticenvironment. Referring to FIG. 27a, a cancellation loudspeaker 1c cantherefore be provided within a room connected via a cancellation filter50c to the audio source 4. With a single cancellation loudspeaker, thesignal to be produced by the loudspeaker 1c should correspondessentially to the signal received at 1c as processed by the filter pathvia the compensation filter 5a, loudspeaker 1a and acoustic environment2.

As discussed above, the response of the loudspeaker 1a is substantiallycompensated by the filter 5a; the principal component of the filter 50cis therefore due to the differences in response of the path through theenvironment 2 to the zone 3 for which the filter 5a is optimised and tothe loudspeaker 1c. One significant component of this is a time offlight delay, since the speaker 1c operates to cancel sound reaching areflecting surface beyond the listening position 3.

In general, some or all loudspeakers 1a, 1b, 1c may act both as soundreproducing loudspeakers and as cancellation loudspeakers. These twofunctions are however conceptually distinct as will be explained below.

As stated above, we have found that long lasting reverberations, even ifof relatively low amplitude, are noticable by the listener. When morethan one cancellation loudspeaker is employed, there is no reason whythe or each microphone used to derive the parameters of the cancellationfilters should be positioned near the cancellation loudspeakers. What isdesired is to derive cancellation filters such that the reverberationsin the room perceived by a listener within the compensation zone 3 arereduced. It might therefore be thought that the best position for themicrophones is in or around the compensation zone 3. However, we havefound that whilst this will tend to reduce the amplitude of early partsof the reverberation envelope, it has significantly, less effect inreducing the long tail of the envelope which is perceptually morenoticable. We have found, surprisingly, that it is preferable toposition the microphones in corners of the room and derive theparameters of the cancellation filters to minimize the signals receivedby the mirophones at those positions.

Both reproducing loudspeakers 1a and cancellation loudspeakers 1b and 1cmay be provided within a room, although in general each loudspeaker mayreproduce and cancel sound. The audio source 4 is connected directly tothe reproducing speaker 1a and is connected to the cancelling speakers1b and 1c via respective cancelling filters 50b and 50c. In deriving thecancellation filters, four microphones 7a-7d are provided near thecorners of the room, although diametrically opposite corners of a cuboidroom contribute essentially identical information, so no more than fourmicrophones in corners are necessary. If further microphones areavailable, they may be positioned within the interior of the room. Onesuitable location for the microphones 7a-7d in practice is physicallywithin the housing of the loudspeakers 1a-1c; with some moving coilloudspeakers, the loudspeaker itself can be employed as a microphone.

The first step is to measure the impulse response from each of theloudspeakers 1a, 1b, 1c to each of the microphones 7a-7d. This isachieved by generating a test signal through each of the loudspeakers1a-1c in turn, and digitising and storing the signal received from eachof the microphones 7a-7d over a relatively long period of up to a secondor more. Designating the impulse response of the path from thereproduction microphone 1a as R₁ and that from the cancellationloudspeakers 1b and 1c T₁₁ and T₁₂, the response at the microphone 7a toan impulse test signal is R₁ +T₁₁ *F₁ +T₁₂ *F₂, where F₁ and F₂ are thefilter impulse responses (for an FIR filter, the coefficient sets) ofthe cancellation filters 50b, 50c. Equivalent equations can beconstructed for the signals received by each of the other microphones.The impulse responses R and T have already been measured. By using theactual impulse responses devised from the microphones 7a-7d, thecoefficient calculator 6 derives values of impulse responses F1, F2 offilters 50b, 50c which result in the lowest squared amplitude of thesignals which would arise at the microphone positions and hence thelowest amount of audio energy in the room.

Since it is desired to reduce the later parts of the envelope so as toreduce the decaying tail of the reverberation, the filter coefficentsmay be calculated in such a way that minimizing the amplitude of theselater portions of the reverberation is given greater weight thanminimising the earlier portions.

A test signal is supplied to the room by test signal generator 8 via theor each reproducing loudspeaker 1a. The response measured at thespeakers 7a-7d is digitised and stored by the coefficient calculator 6,to give a sequence of samples lasting up to one second or more from eachmicrophone. If the test signal was not an impulse response, the transferfunction of the test signal is deconvolved with the measured signalvalues to yield for each microphone a corresponding series of impulseresponse samples. For simplicity, in the following, a sampling rate of 1kHz is assumed.

Referring to FIG. 28, a first set of, say, sixty impulse responsesamples are read from the buffer memory containing the measuredresponses for each microphone. The total number of such data is then4×60=240. Preferably the first samples of the measured impulse responsesare not taken into account at all in deriving the filter coefficients,so as to avoid distorting the early part of the room response. Forexample, the first set may be the sixty samples from 40 msecs to 100msecs after the initiation of the test signal.

Using the known stored values of R and T, the coefficient calculator 6then calculates a first set of transversal filter coefficients (forexample, the first 30) for each of the filters 50b, 50c so as tominimise the least mean squared amplitude value (i.e. the power orenergy) of the signal which would be measured by the microphone 7a-7dwith the subsequent coefficients set to zero; this is straight forwardsince 240 data are available for solving 60 unknowns, and any standardmethod for solving a linear least squares problem of this kind may beemployed (for example, normal equations, Gram-Schmit Orthogonalization,Householder Transformation, Givens Rotation etc.).

The result is that a first set of coefficients for each of thecancellation filters which reduce the energy within the impulse responseof the acoustic environment 2 (as measured at the four microphonepositions 7a-7d) at a later time have been derived.

The next step is to calculate the next filter coefficients (i.e. thoseoccuring later in the impulse response at the cancellation filters) froma later portion of the measured impulse responses from the microphone7a-7d. Preferably, this is achieved by selecting the next set of sixtymeasured impulse response samples for each microphone 7a-7d so as tooverlap the first set; for example, the second set may be samplesbetween t=50 msecs and 110 msecs.

The first ten coefficients derived for each filter are correspondinglyfixed, and the next set of two hundred and forty measured signal dataare used to derive a further set of thirty coefficients (the eleventh tofortieth coefficients) for each of the filters 50b, 50c. Once all thecoefficients (for example, sixty coefficients) of each filter have beenderived, the process may if desired be repeated, using the just derivedcoefficient values rather than zero as the starting values forcoefficients. Once the coefficient values have converged (that is, thedifference between values calculated between a calculation cycle and thepreceding cycle is less than a predetermined level) the coefficentvalues are supplied to the cancellation filters 50b, 50c for subsequentreproduction.

As stated above, each of the cancellation filters 50b, 50c is derived toincludes a substantial delay such that the cancellation filter exhibitsno substantial response before sound from the reproducing loudspeaker 1ahas reached the cancellation loudspeaker. It is therefore possible tocombine cancellation filters 50b, 50c with compensation filters 5 of thetype discussed above, most of the response of which occurs prior to thatof the cancellation filters. To avoid conflicts between the two separatefiltering processes, however, it may be desirable to restrict theacoustic environment equalisation portion of the filter 5 to relativelyhigh frequencies and the response of the cancellation filters 50 torelatively low frequencies.

Crossover Equalisation

As stated above, the crossover network of the loudspeaker 1 is generallyan analogue filter circuit. In achieving desired amplitudecharacteristics, the effect of the crossover network is to introducesubstantial phase distortions. We have found surprising increase inpsycho-acoustic acceptability of a signal when a digital filtercalculated to linearise the phase distortions due to the crossovernetwork is employed. Since such a filter needs to be acausal, it is bestrealised as a transversal filter, for example a digital FIR filter.

To derive such a filter, the crossover network of the loudspeaker 1 isdisconnected and its impulse response is measured by supplying anelectrical signal to the input and summing the outputs as shown in FIG.29. Ideally, if the overall amplitude of the crossover network wereessentially flat, the impulse response would contain substantially onlyphase information. To provide a filter which when cascaded with thecrossover network will result in a linear phase system, it would thusmerely be necessary to reverse the measured impulse response so that thelast coefficient of the measured response becomes the first coefficientof the compensating filter response, as shown in the FIG. 30.

Of course, this method has the effect of doubling the size of amplitudevariations in the actual crossover network response; if the ripples inthe amplitude response are substantial, it is preferred to derive thephase spectrum or all pass component of the crossover network responseand equalize only that. Alternatively, the response of the wholeloudspeaker unit including acoustic portions may be equalized over thecrossover frequency band.

Once the coefficients have been derived, a corresponding filter can bemanufactured either as an analogue shift register (such as a chargecoupled device) with the filter coefficients as tap values realised assuitably valued resistors, or by a digital signal processing device ofany suitable commercially available type. A preprogrammed filtersuitable for use with one particular type of loudspeaker may beprovided, or coefficients required to characterise several differenttypes of crossover network may be provided, to be selected by a user tomatch his loudspeaker.

Automobile Compensation

Referring to FIG. 31, an automobile is an example of an acousticenvironment the response of which can be characterised in advance. Inother words, all cars of a particular model will have equivalentloudspeaker mounting positions, (usually) equivalent loudspeakers,equivalent dimensions, and equivalent materials. It is thereforepossible to measure (or even calculate) the loudspeaker and environmentcompensations necessary for any loudspeaker/car combination in advance,and omit from the apparatus according to this embodiment the test signalgenerator 8, microphone 7 and coefficient calculator 6.

The filter 5 is permanently configured to provide compensation for thetype of car and loudspeaker for which it is provided. The compensationzone for which the filter 5 is designed to correct the car environmentto may be a single zone around head height at the driving seat position.Alternatively, the zone may encompass all the passenger positions athead height.

Since the presence of passengers in the car not only effects the choiceof zone for which the filter 5 should compensate but also effect theresponse of the car environment itself (possibly quite radically), in amodification, the filter 5 may be configured to 2 or more settingscorresponding to different numbers of persons--for example, a "driveronly" setting where the coefficients of the filter 5 are derived tocompensate a zone around the driver and in such a way as to take accountof the presence only of the driver in the environment, and a "passengerplus driver" setting in which the coefficients of the filter 5 such asto correct over a volume including the driver and passenger seats, andthe acoustic environment for which the coefficients were derived takesaccount of the presence of a number of passengers.

The filter 5 is provided as a separate unit to accompany a compact discplayer or other audio sound source 4.

Audio High Fidelity Reproduction Apparatus

Referring to FIG. 32, in one embodiment, apparatus suitable for use witha predetermined type of loudspeaker comprises a unit 100 comprisingdigital and analogue input ports 101, 102; digital and analogue monitoroutputs 103, 104 and a pair of analogue loudspeaker outputs 105, 106.Also provided on the unit are a volume control 107, a switch 108 forselecting between filtering and measuring the acoustic environmentresponse; and a status display 109.

Referring to FIG. 33, the digital input 101 is connected to a digitalformat converter 110 arranged to convert the digital signal to astandard format (the SPDIF format). Separate inputs for different typesof digital signal (e.g. from a DAT source or a compact disc) may beprovided.

The format converted digital signal is supplied to a digital signalprocessor device 111 comprising, for example, a TMS 320 C25 processordevice. The elements of such a device are indicated schematically inFIG. 34; it generally comprises a program ROM 111a, and a data RAM 111bconnected via address and data buses (not shown) to processing elementsincluding a multiplyer 111c, arithmetic logic unit 111d and accumulator111e. Predetermined data (relating, for example to the loudspeakerresponse) is held in ROM, and program ROM 111a includes sub-routines forperforming operations such as fast Fourier transform operations (onblocks of, for example, 1024 signal values) and finite response orinfinite impulse response filtering operations according to coefficientsderived and stored in the data RAM 111b.

The analogue input port 102 is connected, via a buffer amplifier 112, toone input terminal of the switch 108. When "filter" mode of switch isselected, the input analogue signal is routed via switch 108 to ananalogue to digital converter 113 having a higher resolution (forexample, 18 bits). The digitized signal sample train may then bequantized, with dithering of the least significant bit to reduce thenumber of bits if necessary to, say, 16 by a quantizer 114.

A switch 115, which may be set responsively to a jack inserted into oneof the sockets 101 or 102, selects between the digital input and thedigitised analogue input signal to be supplied to the data input bus ofthe digital signal processing device 111. The output of the digitalsignal processing device 111 is converted to an analogue signal by adigital to analogue converter 116, buffered by a buffer amplifier 117and supplied, via the volume control potentiometer 107, to theloudspeaker output socket 105 or 106 (FIG. 33 shows only one loudspeakerchannel).

The output of the digital signal processor 111 is supplied, via adigital format converter 118, as a digital output. The digitisedanalogue input is also supplied as a digital output via a digital formatconverter 119 to the digital output port 103.

The digital signal processor 111 performs the function of the filter 5when the switch 108 is set to filter mode and the functions of the testsignal generator 8 and coefficient calculator 6 when the switch 108 isset to "measure" mode. A controller 120 comprising a micro-processor ormicro-controller device is provided to sense the position of the switch108, and control the operation of the digital signal processor 111 inresponse thereto. The controller 120 may also control the status display109 to inform the user of the apparatus of its internal condition.

An external microphone 7 is connectable to a microphone input port 121routed to the analogue to digital converter 113 via the other terminalof switch 108 when the switch is in the "measure" setting.

In operation, when first placed in an acoustic environment it will benecessary for the apparatus to measure the acoustic environmentresponse. The status display 109 may therefore prompt the user to setthe switch 108 to the measure setting (or alternatively, the sameinformation may be provided from an instruction manual). After themicrophone 7 has been connected to the socket 121 and positioned at anappropriate position in the room, the user sets the switch 108 to themeasure setting. This is sensed by the controller 120 which sets thedigital signal processor 111 to function as the test signal generator 8and coefficient calculator 6 by supplying an instruction to execute anappropriate subroutine.

The subroutine causes the digital signal processor 111 to output aseries of digital values corresponding to a test signal, to be suppliedto the loudspeaker 1, whilst reading in and storing successive digitisedvalues from the microphone 7. After a measurement has been taken at themicrophone position (which typically takes several seconds, to allowlong room reverberations to decay) the status display 109 is set by thecontroller 120 to indicate that the measurement is complete and that theuser should move the microphone to another point. Upon his doing so, theprocess is repeated and the second point microphone signal data arestored. After a predetermined number of points, the controller 120instructs the display 109 to indicate that measurements are complete.The microphone 7 may then be un-plugged.

The controller 120 then instructs the digital signal processor 111 toexecute a sub-routine to perform coefficient calculation. Theloudspeaker response will be stored in a read only memory, and from thisand the measured signals the digital signal processor 111 calculates thecoefficients necessary to enable it to filter an input audio signal. Thecontroller 120 then releases the switch 108 into the filter modesetting, instructs the digital signal processor 111 to act as a digitalfilter using the derived coefficients, and indicates on the statusdisplay 109 that the apparatus is ready for audio reproduction.

Other conventional features such as a direct signal bypass path to theloudspeaker 1 (not shown) are also provided. The controller 120 may beperformed by the digital signal processor 111 executing a supervisoryroutine if so desired.

Audio Visual Reproduction

When the filter 5 is acausal, as it will be when linear phasecompensation of the loudspeaker is employed, the filter 5 will produce asignificant signal delay. When reproducing audio material which has anassociated video picture (e.g. replaying a video tape or disc) this willresult in loss of sychronisation between the sound and pictures; this isvery noticable and annoying to a viewer. In an embodiment of theinvention for use in replaying audio visual material, shown in FIG. 35there is therefore provided a video delay 501 of selectable length, thelength being set by a control signal from the coefficient calculator 6to match the delay of the filter 5. Any convenient form of delay linemay be employed; if the signal is received in digital form the delay maycomprise a digital frame buffer and associated addressing logic.

Modifications

Various modifications to the embodiments disclosed may be made withoutdeparting from the scope of the invention. In particular, it will berealised that the particular order of operations shown in the variousflow charts is by way of example only; operations which are by theirnature linear may be combined and their order altered without affectingthe result. Further, each operation of multiplication in the frequencydomain may be if necessary replaced by an operation of convolution inthe time domain, although in general such convolution operations requiregreater numbers of arithmetic operations.

Although the invention has been described particularly with reference todigital transversal or fininte impulse response filters, it is equallypossible to realise the invention using analogue transversal filters ofthe charge coupled device or similar type. Likewise, infinite impulseresponse or recursive filter may be used to implement the invention;algorithms are known for generating suitable parameters of an infiniteimpulse response filter from those of a finite impulse response filterand vice versa.

One economical way of realising the filter 5 shown in FIG. 26 is as arecursive filter 500b comprising a finite impulse response filter in afeedback path, the recursive filter 500b having a minimum phaseresponse, and an acausal transversal filter 500a having a response whichincludes all other parts of the correction response. When linear phaseloudspeaker correction is combined with minimum phase room correction,the filter 500a will comprise the loudspeaker compensation and thefilter 500b the room compensation. However, when the room compensationis non minimum phase, the all pass elements of the room compensation canbe provided by the transversal filter 500a (or may alternatively beprovided by an additional recursive all-pass filter).

We claim:
 1. A method of conditioning programmable filter apparatus (5)to filter a signal supplied to an acoustic transducer (1) located in anacoustic environment (2), comprising supplying, for storage in theapparatus, filter parameters derived by a method which comprises thesteps of:(a) deriving first data relating to a transducer compensationsignal response (F_(L) ⁻¹) which, in combination with the signalresponse (F_(L)) of the transducer (1), substantially reduces thedeviation of the transducer signal response (F_(L)) from uniformity; (b)deriving second data relating to an acoustic environment compensationsignal response (F_(R) ⁻¹) which, in combination with the signalresponse of the acoustic environment (2) over a path therethrough to apredetermined position therein, substantially reduces the deviation ofthe acoustic environment signal response (F_(R)) from uniformity; and(c) deriving subsequently said filter parameters from said first andsaid second data.
 2. A method according to claim 1, in which thetransducer compensation response (F_(L) ⁻¹) is derived so that itseffect, in combination with the transducer response (F_(L)) is such asto provide a substantially constant signal group delay.
 3. A methodaccording to claim 1, in which the transducer compensation response(F_(L) ⁻¹) is derived so that its effect, when in combination with thetransducer response (F_(L)), is such as to compensate phase distortionsin the transducer response which are substantially independent ofposition or direction relative to the transducer (1), whilst leavingsubstantially uncompensated those phase distortions which aresubstantially dependent thereon.
 4. A method according to claim 1, inwhich the acoustic environment compensation response (F_(R) ⁻¹) isderived by the steps of:generating an acoustic signal within saidenvironment (2) via a transducer (1) for which the transducercompensation response (F_(L) ⁻¹) is derived to compensate; measuring thesaid signal at a place (3) in the environment (2); and processing themeasured signal to derive the response (F_(R)) of the acousticenvironment.
 5. A method according to claim 4, in which the signalprocessing is responsive to, and is to take account of, data relating tothe transducer response (F_(L)).
 6. A method according to claim 1including the step of generating spectral data relating to the signalresponse (F_(R)) of the acoustic environment, and processing said datato generate second data such that said acoustic environment compensationsignal response includes substantially less long lasting resonance thanthe inverse of the acoustic environment signal response.
 7. A methodaccording to claim 6, in which the effect of said processing is greaterat frequencies above a predetermined threshold (f_(LOW)).
 8. A methodaccording to claim 6 in which the effect of said processing is greaterat frequencies below a predetermined threshold (f_(HIGH)) which iswithin a frequency range of said filter.
 9. A method according to claim6 in which said processing comprises a step of adjusting the amplitudeof spectral coefficients of a magnitude which would give rise to a longlasting resonance.
 10. A method according to claim 6 in which processingcomprises a step of smoothing said data by processing each spectraldatum in accordance with spectrally neighbouring data.
 11. A filterconditioned according to claim 1.